Utils.round(value, decimals, increments, min, max)
Rounds a number.
译:数轮。
Arguments(参数)
value— A floating point number. 译:浮点数。decimals— The amount to appear after the decimal point. (Optional) 译:小数点后出现的数值。(可选)increments— The increment to round to. (Optional) 译:圆的增量。(可选)min— The minimum value to return. (Optional) 译:返回的最小值。(可选)max— The maximum value to return. (Optional) 译:返回的最大值。(可选)
print Utils.round(100.12345, 0) # Output 100
print Utils.round(100.12345, 2) # Output 100.12
print Utils.round(100.12345, 4) # Output 100.1234