How to display 4 decimal places in the currency

Ciao a tutti,
I am making a small program to generate quotes.
I have the problem of displaying 4 decimal places in the single piece price. I have tried searching the net if there is a solution, but I have not found it.

Is it possible or is it one of those basic functions that should be considered and implemented? :slight_smile:

Thanks in advance to anyone who can help me.

Hi @Indave,

Unfortunately there is no way to limit number of decimals directly in the label. However there are some workarounds :slight_smile:

If you set up your number (magic text properties) to be displayed as “currency”, it will always add the currency sybmol(s) and it will always add 2 decimal digits.

You can also use a custom formula like this: INT (price * 100) / 100. It won’t always display 2 decimals, but it will remove extra decimals. By the way if you need 4 decimals it will look like INT (price * 10000) / 10000.
INT may be replaced by ROUND here

Another option is to split decimals and whole numbers and put 2 labels. To get a whole number, you will need to use a formula INT (price). To get the decimal part, the formula will be more complex:
INT ( ( price - INT (price) ) * 100 ).
INT can’t be replaced by ROUND in INT(price)

Let’s take an example: we have the price of 125,67.
INT (price) = 125.
( price - INT (price)) = 125,67 - 125 = 0,67.
( ( price - INT (price) ) * 100 ) = 0,67 * 100 = 67. This number could be displayed as cents.
And we apply another INT just to be sure to get rid of some unexpected extra decimals.

Hope this helps.

Best regards, Victor.

Grazie Victor,
I will try to incorporate your suggestions :slight_smile:

1 Like

Works fine! Thank U so much :slight_smile: @Victor

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.