I want to use Javascript to round up a number. Since the number is currency, I want it to round up like in these examples (2 decimal points):
- 192.168 => 192.20
- 192.11 => 192.20
- 192.21 => 192.30
- 192.26 => 192.30
- 192.20 => 192.20
How to achieve this using Javascript? The built-in Javascript function will round up the number based on standard logic (less and more than 5 to round up).
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…