in reply to Re: Re: Separating big numbers with commas
in thread Separating big numbers with commas
Looks fine to me....
Output#!/usr/bin/perl -wT use strict; my $number='1234567890.01'; # with commas, should be "1,234,567,890.01 +" print "N=$number\n"; $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; print "N=$number\n";
Care to elaborate on which part doesn't work?N=1234567890.01 N=1,234,567,890.01
-Blake
In Section
Seekers of Perl Wisdom