Gossamer Forum
Home : General : Perl Programming :

why does perl round my numbers ?

Quote Reply
why does perl round my numbers ?
-- I have a very basic script:

my ($sec,$min,$hour,$mday,$foo) = localtime time;
$time_now = "$hour$min";

-- I purposely leave out the ":" because i want the whole number.

How come when the time is 10:05, i print $time_now , and it returns '105' ?? It should be 1005. WHERE DID MY EXTRA '0' GO ? It only does this with zero's. If the time was 11:35, it would print 1135 just like i want it to. anyone know how to stop it from doing that ? Thanks in advance for your help :)
Subject Author Views Date
Thread why does perl round my numbers ? mtorres 5632 Dec 24, 2003, 7:13 AM
Thread Re: [mtorres] why does perl round my numbers ?
Chaz 5528 Dec 24, 2003, 8:09 AM
Thread Re: [Chaz] why does perl round my numbers ?
mtorres 5520 Dec 24, 2003, 8:14 AM
Post Re: [mtorres] why does perl round my numbers ?
Chaz 5499 Dec 24, 2003, 8:40 AM