Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Decimal data formatting
Manilal
Hi,
Using BIRT 2.5.1
In my reports the amount fields need to be formatted dynamically based on a pattern passed as a parameter. Field type used is 'Decimal'.
For example, if the user selects a pattern from a drop down (eg: ##,###.00) and run the report this format should be applied on all amount columns in the report displayed.
Please advice me how this can be done...
Thanks in advance,
Manilal
Find more posts tagged with
Comments
mwilliams
Hi Manilal,
You should be able to put something like this into the onCreate script of each data item you want to change format with the parameter choice:
this.getStyle().numberFormat = params["format"];
Hope this helps.
Manilal
Hi Williams,
Thanks for the reply and it is working for me.
I have another related issue. The requirement is to use a number format something like '## ###.##' (With a space in between)
When I tried to apply this pattern Birt discards the space and showing a value like 179549.68
Is there a way to get the above number formatting apply on amount fields?
Thanks,
Manilal
mwilliams
Manilal,
It doesn't look like you'll be able to include a space there. It looks like anything but a . or , gets pushed to the end of the numerical string. You can see this by putting in an underscore (_) where you're putting the space.
Manilal
Hi Williams,
Thanks for the response.
I would like to know how can use a decimal separator other than . and group separator other than , for formatting a decimal.
I tested the different currency formats based on locale but I need to apply user selected decimal and group separators irrespective of the current locale.
Please advice me on this..
Thanks,
Manilal