Answers for "how to parse bigdecimal to long in java without loosing decimal value"

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 "how to parse bigdecimal to long in java without loosing decimal value"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language