Quantcast
Channel: Pochampalli IT Labs
Viewing all articles
Browse latest Browse all 261

Tip: Get two numbers after decimal point for Big Decimals or Doubles in Jasper Reports By converting to String

$
0
0
Hi,
This tip is useful to extract 2 numbers after decimal points in Jasper Reports

Syntax : 
String.format("%.2f",(double)value);


 String.format("%.2f",(double)($F{UnitSales}.doubleValue()*$F{Rate}.doubleValue()))

456.325 * 2.376
Sample Result : 1084.2282 

After applying the above format in expression editor of text field in jasper 
The result would be : 1084.22

References :
http://stackoverflow.com/questions/50532/how-do-i-format-a-number-in-java

Viewing all articles
Browse latest Browse all 261

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>