Jump to content
We've recently updated our Privacy Statement, available here ×

Aligning to Decimal Point


ongey

Recommended Posts

Greetings all, I have some requirements to format currency amounts in Jasper Reports.  I know I can utilize Java formatting facilities, but there are some interesting other requirements:

- Align to the decimal point

- Do not display the fraction if not present

- Formatting defined per currency

For example, say for GBP amounts, we want to display at least 2 leading and trailing zeros, 3 decimal places, and the above formatting, followed by the currency.  So, given the set of amount {123.456, 3.4,  3.4567, 123, 0.456, 0.0} the following will be output (note I've had to use a monospaced font to get it right):

123.456 GBP

 03.40  GBP

 03.457 GBP

123     GBP

 00.456 GBP

 00     GBP

Apologies in advance if this is already discussed on the forums - I did have a check.  I'm relatively new to Jasper Reports too.  Any help would be much appreciated! (especially on aligning by decimal point in any chosen fontt - although that may not be possible).

    Neil.

 

Link to comment
Share on other sites

  • 4 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...