[HowTo] Numbers with decimal points

I want to implement to calculate with money…
so I need to have decimal points
In the Forum I found the trunc() function

If I do this:

10/3 = 3.33333

trunc(10/3) = 3

But I want to get this:

10/3 = 3.33

So I will be able to calc with Euros and EuroCents…

maybe someone can helping out here…

We can use this :

trunc(YOURNUMBER * 100) / 100

It “trunc” your number multiplied by 100 (if you have 3.33333, you will have 333), then it divides by 100 (so, you obtain 3.33).

1 Like