I'd like to round at most 2 decimal places, but only if necessary .
(我想最多舍入小数点后两位,但仅在必要时才可以 。)
Input:
(输入:)
10
1.7777777
9.1
Output:
(输出:)
10
1.78
9.1
How can I do this in JavaScript?
(如何在JavaScript中执行此操作?)
ask by stinkycheeseman translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…