Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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";


Comment on Re: number to date conversion
Download Code
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 rifling through the Monastery: (10)
As of 2014-12-26 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls