Tag: rounding

57 votes
1 answers
2.8K views
Rounding BigDecimal to *always* have two decimal places

I'm trying to round BigDecimal values up, to two decimal places. I'm using BigDecimal rounded = va

avatar
Rufus
0 1 0 9
asked 07 September, 2021
60 votes
11 answers
2.4K views
How can I round down a number in Javascript?

How can I round down a number in JavaScript? math.round() doesn't work because it rounds it to the neare

avatar
Rufus
0 1 0 9
asked 07 September, 2021
71 votes
30 answers
2.9K views
How to round to at most 2 decimal places, if necessary?

I'd like to round at most 2 decimal places, but only if necessary. Input: 10 1.7777777 9.1 Output: 1

avatar
Lashawna
0 1 0 9
asked 07 September, 2021