Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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?
[Lady_Aleena]: Hello. Why is this dying at -exec: my @music_times = qx(find ~/Music/Albums/ -type f -iname '*.mp3' -exec {} \;); with the error find: missing argument to `-exec'
[Lady_Aleena]: ACK! my @music_times = qx(find ~/Music/Albums/ -type f -iname '*.mp3' -exec mp3info -p "%S\n" {} \;);
[marioroy]: :)
marioroy adds oatmeal cookies to the platter on the sideboard.
marioroy adds oatmeal raisin cookies to the platter on the sideboard.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-04-23 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (430 votes). Check out past polls.