[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] A parseing we will go....



Hi all,

    I'm curious to see how others might solve a little coding problem I
worked on this week.
You have a number, floating point. Could be

001254.6987 or 0.2500 or 012.685000
There's any number of leading or trailing zeroes before and after the
decimal I want to get rid of.
If they are all zeroes I need 1.0 instead of 1.00000 and 0.1 instead of
00000.1. Otherwise I just need to lop off the leaders or trailers.
Any takers?
A direct cc would be appreciated.

Allan

Allan Greenier
AutoScript Applcations

agreenier@snet.net
http://www.geocities.com/~autoscript






# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org