Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Formatting issue in BIRT 2.5.0
somashaker
<p>Hi</p><p>I am using BIRT 2.5.0 .</p><p> </p><p>while displaying decimals on report I am facing issue.</p><p> </p><p>for example from database I am getting value as 25.23324 i need to display it as 25.23(I need to round it)..</p><p> </p><p>I did many work arounds but unusuccessfull.</p><p> </p><p>logic which I used was</p><p> </p><p>df = <strong class='bbc'>new</strong> Packages.java.text.DecimalFormat("##.##");</p><p>df.format("value");</p><p> </p><p> </p><p>Please help me in getting the output as below format</p><p> </p><p>if input is 25.23232 : output sholud be 25.23</p><p>if input is 25 : output should be 25.00</p><p> </p>
Find more posts tagged with
Comments
shorne
<p>The formatting pattern used is pretty much the same as what is found in java DecimalFormat. The pattern "#,##0.00" will do what you want. Also, adding comma seperation for thousands and the rounding is taken care of by the formatter.</p><p> </p><p>See javadocs for full documentation on DecimalFormat</p><p><a data-ipb='nomediaparse' href='
http://docs.oracle.com/javase/1.4.2/docs/api/java/text/DecimalFormat.html'>http://docs.oracle.com/javase/1.4.2/docs/api/java/text/DecimalFormat.html</a></p>
;
micajblock
<p>Why are you not using the format options in the properties (see attached image)?</p><p> </p><p> </p>
somashaker
<p>Thanks mblock</p>