rounding off decimals

0
hi  I need to round off decimals to 2 places for a string value so i need to convert string to decimals first and then round it off to 2 values like 1.22 how can that be achieved 
asked
1 answers
2

You can add a precision to the round function: 

round(parseDecimal($String),2)

 

If you want to end up with a string, you can use toString on the result.

answered