develooper Front page | perl.beginners | Postings from January 2002

RE: decimal point

Thread Previous | Thread Next
From:
Darren Simpson
Date:
January 28, 2002 01:59
Subject:
RE: decimal point
Message ID:
2AE874B52AAA1E42A0446E353900D69D24F926@jpl02.jplgroup.co.uk
did i say 10? i meant 100

-----Original Message-----
From: Darren Simpson 
Sent: 28 January 2002 08:48
To: 'Stuart Clark'; Perl List
Subject: RE: decimal point


i would try dividing the number by 10

-----Original Message-----
From: Stuart Clark [mailto:sc@spacelink.com.au]
Sent: 28 January 2002 01:57
To: Perl List
Subject: decimal point


Hi,
I am trying to move the decimal point 2 places to the the left.
 
Eg : To make 4536233 into 45362.33
 
I tried this 
$total = "4536233";
$total = sprintf("%0.2f",$total);
print "$total";
But I get this
4536233.00
 
Can anyone help please
 
Regards
Stuart Clark
 
 
 
 
 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About