[OT] perl help on number modification

Gianluca Cecchi gianluca.cecchi at gmail.com
Thu Jan 14 10:10:03 UTC 2010


Hello,
any hint on trasforming with perl a number using only one substitute
function for reg exp?
Todo:
1.20 must become 1.2
1.00 must become 1
1.25 must remain the same

So that if after the dot are all zeros, I have to subtitute with
corresponding integer, and in general I have to remove trailing zeros
for decimal numbers.

Thanks in advance,

Gianluca


More information about the users mailing list