Appearance
@pmun/utils / round
function round(num, precision): number;
将数字四舍五入到指定小数位
number
要处理的数字
number = 0
0
小数位数,默认为0(整数)
四舍五入后的数字
round(3.1415) // 3 round(3.1415, 2) // 3.14 round(3.1415, 3) // 3.142 round(3.9999) // 4