Skip to main content
Participant
May 8, 2019
Question

How do I hide third place decimal when it's zero?

  • May 8, 2019
  • 2 replies
  • 1519 views

For example. There are occasions when I need the number to say $60,000.125. But another line might cost $12,000.670 But I want it to read $12,000.67 when the third place is zero. Any thoughts? Please help!

Thank you!

This topic has been closed for replies.

2 replies

Legend
May 8, 2019

It may sound a bit esoteric, but there is actually a difference between 1.230 and 1.23.

In the first case, the precision is ensured to be 3 digits, whereas in the second case, it is 2 digits. For common uses, this does not make much of a difference, but if you have to ensure the precision over the whole process, it does matter.

Legend
May 9, 2019

Calculating with money needs a special discipline, otherwise auditors and lawyers will be upset.

Consider this purchase

ITEM 1      1.124

ITEM 2      1.124

ITEM 3      1.124

TOTAL       3.372

Ok, let's round these to the nearest cent on each line

ITEM 1      1.12

ITEM 2      1.12

ITEM 3      1.12

TOTAL       3.37

However, anyone can see this no longer adds up. This is inviting legal action, or a complete loss of cusomer confidence.  You actually have to really round each line item's price, not just show less digits on the page

ITEM 1      1.12

ITEM 2      1.12

ITEM 3      1.12

TOTAL       3.36

try67
Community Expert
Community Expert
May 8, 2019

Is this a calculated value? If so, what code are you using for it?

Participant
May 8, 2019

This is what I have. I'm just using the regular formatting when creating a form. Qty x Unit price = Amount

Looking for when the third decimal is zero, to be hidden if possible. Does that make sense?

try67
Community Expert
Community Expert
May 8, 2019

You'll have to use a custom Format script to be able to do it.