Jump to content
Changes to the Jaspersoft community edition download ×

adding Leading zeros to a numeric field


keith.crown

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

JasperSoft Studio has the TEXT function which you can use in the "Text Field" like this...

TEXT($F{QR},"000000")

Here the field QR is an integer, and the TEXT function converts it to a value with the "right number" of leading zeroes.

For example, if QR = 1037, then you'd get 001037 from the function.

HOWEVER...

If it's floating point you need, then the other answer works.

ALSO

On the Text Field property, there's an entry called "Pattern"

There you can pretty much play with formats kind of like in Excel.

Link to comment
Share on other sites

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...