Lingo Function - Delete Zero in Decimals


To delete unneccessary Zero(eg. 2.000, 2.10100) after a decimal point, you can apply the following function:

on deletefloat output
——————delete float————–
repeat with k = member(output).char.count down to 1
if member(output).char[k] = “0″ then
put “” into member(output).char[k]
else
exit repeat
end if
end repeat
if member(output).char[member(output).char.count] = “.” then
put “” into member(output).char[member(output).char.count]
end if
——————delete float————–
end

The “output” is the your text member’s name. :D
Have fun!

Tags:
 If you like this post then please subscribe to my full feed RSS.
   Similar Posts:

Leave a Comment

Name (required):

E-mail (will not be published) (required):

Website (optional):

Comment: