Decimal round off

0
Hi All I want to round off a decimal to 2 decimal places without incrementing For Example: $var=3.2198 should be 3.21 and not 3.22 I have tried formatDecimal($var/NumberInput,'##.##') which gives me a string ‘3.22’
asked
2 answers
1

Hi Ajit,

You can use this function: round(floor(3.2198 * 100) div 100,2)

answered
1

Hi Ajit,

I would suggest  you can try to this by some parsing , as below:

Example : $Variable = 3.2148

Parsing function : parseDecimal(substring(toString($Variable),0,find(toString($Variable),'.')+3))

Output : 3.21

You can try to create a Rule with this parsing and re-use it multiple places.

Hope this helps!

Regards,

Sunit Kumar Dubey

answered