Re: Leading zeroes

2004-01-10 Thread John W. Krahn
Olivier Wirz wrote: > > Hello, Hello, > How can I suppress the leading zeroes, except one when all positions are 0; > for example: > > 15 will be 15 > 00 will be 0 Just use the "numbers" in a numeric context: $ perl -le' for ( &quo

Re: Leading zeroes

2004-01-10 Thread James Edward Gray II
On Jan 10, 2004, at 8:34 AM, Olivier Wirz wrote: Hello, How can I suppress the leading zeroes, except one when all positions are 0; for example: 15 will be 15 00 will be 0 See if this one-liner gets you going: perl -le 'foreach (@ARGV) { s/^0+([0-9])/$1/; print; }' 15 0

Re: Leading zeroes

2004-01-10 Thread Andrew Gaffney
Olivier Wirz wrote: Hello, How can I suppress the leading zeroes, except one when all positions are 0; for example: 15 will be 15 00 will be 0 This is a pretty vague question. How are you outputting the numbers? Are you writing to a file, using print, using printf, etc.? -- Andrew

Leading zeroes

2004-01-10 Thread Olivier Wirz
Hello, How can I suppress the leading zeroes, except one when all positions are 0; for example: 15 will be 15 00 will be 0 thank you. Olivier -- +++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net -- To unsubscribe, e