How to truncate a dynamic number from 1.2323223232321 as example to 1.23

I have long decimal numbers that are dynamic and different and I cannot get them to two decimals from my source how I can do this in my scenario. For example, my number is 1.232322323232 and I want to get 1.23 thank you!

Can you use the formatNumber() function?

{{formatNumber(1.232322323232; 2; “.”; emptystring)}}

This will round as well so something like 1.2353223 will result in 1.24.

If you don’t want the rounding and want to truncate instead you could try something like this:

{{substring(1.235322323232; 0; indexOf(1.235322323232; “.”) + 3)}} → results in 1.23 instead of 1.24.

formatNumber works fine thank you. Wasn’t sure how to use that function.

1 Like

Documentation on it is not good :frowning: