How do I remove trailing zeros from a decimal number which is in text format. For Ex. Input 12345.60891200 should return 12345.608912 as output. We can't use decimal as input or output as it has its limitation that increments last number or puts number into exponential format. I want to keep number as it is except removing trailing zeros if any so that actual value does not change.
OriginalPostID-225901
Discussion posts and replies are publicly visible
works ok if there is always a decimal place, but strips 0's from integers as well, i.e 120 = 12
you can add simple if condition to fix this
if( find(".","12345.60891200", 1) > 0, regexreplaceall("0*$","12345.608912000",""), "12345.608912000" )