How to Round Formula Results to Two Decimal Places?

Hello,

I have several formulas that allow me to calculate the discount, taxes, and total amount based on the subtotal. Everything works perfectly, but sometimes the results are not rounded, and I would like them to be rounded to two decimal places. Here are the formulas I’m using:

  • Discount: {{sum(21.Price * 0.15)}}
  • Taxes: {{sum((21.Price - (21.Price * 0.15)) * 0.20)}}
  • Total amount: {{sum((21.Price - (21.Price * 0.15)) + ((21.Price - (21.Price * 0.15)) * 0.20))}}

How can I modify these formulas to round the results to two decimal places?

Thanks in advance for your help!

Hi @MVIIX.C

Use the below formula to round to 2 decimal point:
{{formatNumber(sum(131.s; 184.hh); 2; “.”)}}
image

Output:
image

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

For rounding numbers, you can use the recently introduced trunc() function.

Cheers,
Henk

2 Likes