Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Java :: graph contains a cycle 
Java :: How to perform quick sort, in Java? 
Java :: string length in java 
Java :: implement the bubble sort algorithm on the following arraylist 
Java :: timestamp to date java 
Java :: str.substring last 2 java 
Java :: Failed to collect dependencies at net.sf.jasperreports:jasperreports:jar:6.2.0 
Java :: array java 
Java :: iterate through hashMap by forEach loop 
Java :: java loop through list 
Java :: measure running time of a statement java 
Java :: how to find numbers of digits in java 
Java :: Array list deep copy 
Java :: java check if file exists 
Java :: export java_home linux 
Java :: java string static arrat 
Java :: android kill other app programmatically by package 
Java :: java print pdf to printer 
Java :: spigot dispatchcommand 
Java :: jbutton open jframe java 
Java :: difference between two LocalDateTime java 
Java :: Cause: zip END header not found 
Java :: find minimum number in java 
Java :: java priority queue 
Java :: check folder for files java 
Java :: java stream loop 
Java :: one line if statement java 
Java :: android toast 
Java :: install java using cmd 
Java :: volley android 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =