酷代码 AI
菜单
服务商

用maxscript语言编写一个脚本代码,可以实现保留长度数值到小数点后两位

```maxscript fn roundToTwoDecimal places = ( local num = 123.456789 local roundedNum = round(num * (10^places)) / (10^places) return roundedNum ) print roundToTwoDecimal(2) -- 输出: 123.46 ``` [2024-10-10 18:50:48 | AI写代码神器 | 83点数解答]

相关提问
实用工具查看更多
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]
数独游戏 [娱乐类]
经典推箱子 [娱乐类]
AI摸鱼五子棋 [娱乐类]