http://www.perlmonks.org?node_id=1038258


in reply to number to date conversion

Suggestion:
use 5.014; my $str = "123456"; say join '/' => $str =~ /../g; my $val = "213450"; my ( $whole, $dec ) = $val =~ /(.*?)(..?)$/; $dec = "0$dec" if length $dec == 1; $whole =~ s/(.{1,3}?)(?=(...)+$)/$1,/g; $whole //= 0; say "$whole.$dec";

Replies are listed 'Best First'.
Re^2: number to date conversion
by sathya83aa (Acolyte) on Jun 13, 2013 at 07:47 UTC
    Thanks for your reply jnyman..I have the perl version v5.8.8 only, so unable to run your command. Can you please help me with someother suggestions?