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)
Rounding-off/Truncating the numbers
kumaresh
Hi
The reports that i design in BIRT has the following requirement.
The report has numbers to be displayed in the format #,###,##0.00.
Currently, am using the following syntax in the onRender method to achieve the above.
Formatter.format(amount, "#,###,##0.00;(#,###,##0.00)");
By this approach, the numbers are getting rounded off. For example, if the number is "765.928", it gets displayed as "765.93" where as the requirement is not to round off the numbers but to truncate the extra digits.
The number should actually be "765.92".
Is there any syntax available that I can make use of to achieve my requirement?
Thanks in advance.
regards,
Anand Kumaresh.
Find more posts tagged with
Comments
johnw
In the property editor, you can select the Data element, and choose Format Numbers. Since this is for display, you also have the option to convert to string and just do a sub string with a end set to 2 positions after the "." character.