Jump to content

Dropping trailing zeros


Recommended Posts

My customer is sending data to us that we're populating on our PDF. One of the bits of data is a rate percentage - 2.20. They would like that trailing zero to populate on the PDF and I can confirm that it is in their data.

How would I keep that?


When I preview it from my template on the desktop it's alright, but when its processed from the server the zero gets dropped.


Is there a javascript rule I'm missing?


(Call the field RateX)

Link to comment
Share on other sites

I don't know why the data would preview a certain way and compose another. It sounds like the data string is being converted to a number. Are you using a rule to return it? If so, what is the rule?


You could explicitly specify that the result should be a string:

return Str(Field("RateX"));


Or you could use the FormatNumber function:

return FormatNumber('0.00', Field("RateX"));

Edited by step
Forgot a closing paren
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...