Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Eliminating Trailing Zeros

by Trimbach (Curate)
on Jul 17, 2003 at 14:37 UTC ( #275226=note: print w/replies, xml ) Need Help??


in reply to Re: Eliminating Trailing Zeros
in thread Eliminating Trailing Zeros

$n=~s/\.|\.0+$//
That's broken. It deletes the period but leaves in the trailing zeros. This is better, and does what's requested:
s/\.?0*$//;

Gary Blackburn
Trained Killer

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://275226]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2020-10-22 20:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (230 votes). Check out past polls.

    Notices?