Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert whole number into number with decimal 1

Status
Not open for further replies.

ppeel

Programmer
Dec 7, 2004
18
US
I have a field that is supposed to be a number with a decimal point, ie. 0351.69, but it looks like 035169 in the file. How do I print it to look like 351.69?

Thanks in advance for your help.
 
try this:

$num='035169';
$num=sprintf('%5.2f',$num/100);

print "num=$num\n"; # will print '351.69'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top