Perlist at blogspot
2012/11/08
Efficient splitting every 3 digits
my $num = 12_345_678;
$num = reverse $num;
$num = reverse join( ' ', grep( $_, split( /(...)/g, $num ) ) );
# $num = '12 345 678';
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment