Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #setting #scale #big #decimal #java
ADD COMMENT
Topic
Name
7+2 =