Scratch Modules Gallery

四舍五入到 n 位

将数字四舍五入到指定的小数位数(n)。

数学 四舍五入

Contributors: LuYifei2011

Scripts

主脚本

define Round (num :: custom-arg) to (n :: custom-arg) bits
set [result v] to ((round ((num :: custom-arg) * ([10^ v] of (n :: custom-arg)))) / ([10^ v] of (n :: custom-arg)))

Variables / Lists

NameTypeScope
resultVariableSprite