Forum Discussion

Manigandan's avatar
Manigandan
New Contributor II
3 years ago

Need Help in Logic

Hi All,

My input is 123.45 → i should transform as 12345
123.456 then i should transform as 12345 should include only two characters after decimal point.

thank you in advance!

4 Replies

  • Hi Manigandan,

    Try with this expression: $num.toString().substring(0, $num.toString().indexOf(“.”) + 3).replace(“.”, “”)

    Where $num is the field name of the number.

    Thanks,
    Pero M.

  • Or you can also do a parseFloat($num.toString()).toFixed(2).replace(‘.’,‘’)

    FYI, this will force .00 for whole numbers e.g. 123 will be 12300

    😀