我只知道有 round,但只能取成整數,所以如果要小數點第一位可能可以先乘10,運算後再除回來
round(
n_arg
)
=> x_result
Description
Rounds a floating-point number to its closest integer value.
Arguments
n_arg Floating-point number.
Value Returned
x_result Integer whose value is closest to n_arg.
Example
round(1.5) => 2
round(-1.49) => -1
round(1.49) => 1