Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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
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 cooling their heels in the Monastery: (11)
As of 2015-07-29 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls