Answers for "java big decimal"

1

setting scale to big decimal java

// 1.
new BigDecimal("35.3456").round(new MathContext(4, RoundingMode.HALF_UP));
//result = 35.35
// 2.
new BigDecimal("35.3456").setScale(4, RoundingMode.HALF_UP);
// result = 35.3456
Posted by: Guest on September-09-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language