java - How to round up my BigDecimal to have 2 digits after the decimal point? (scala) -
this question has answer here:
- scala doubles, , precision 10 answers
- java bigdecimal: round nearest whole value 6 answers
what best solution make bigdecimal have 2 digits after decimal point (while keeping precise possible) in scala?
val bigdec1 = bigdecimal(12345.12) val bigdec2 = bigdecimal(1345.12) ((bigdec1/bigdec2)*100)
the last row equal 917.7709051980492446770548352563340
want 917.77
.
Comments
Post a Comment