didn't see a sprintf solution...
which produces....#!/usr/bin/perl use strict; my @num = ( "000006", "00005.55", "0004.5650"); foreach (@num) { print $_, " becomes: "; print sprintf("%d\n", $_); }
000006 becomes: 6 00005.55 becomes: 5 0004.5650 becomes: 4
In reply to Re: Removing leading zeros
by wardk
in thread Removing leading zeros
by idunno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |