Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: number to date conversion

by jnyman (Acolyte)
on Jun 11, 2013 at 13:34 UTC ( #1038258=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-10-01 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (578 votes). Check out past polls.