
19th August 2008, 05:58 PM
|
|
Junior Member
|
|
Join Date: Aug 2008
Posts: 1
Credits: 0
|
|
Perl-How can I make this $total to be a round number?
this is what i have:!# usr\bin\perl -wprint "----------------Welcome to tax calculator!----------------\n";print " ------By Jason------\n\n";print "Please enter a tax rate in decimal.\n";print "example: Enter 0.085 for 8.5%\n";chomp ($tax_rate = );while (1){print "Enter the price of the item, then press enter.\n";print "or\n";print "Hit Ctrl+C to quit.\n";chomp ($cost = );$total = $cost * (1+$tax_rate);if ($cost < 0.009){print "Please enter a number higher than 0.01.\n";print "---------------------------------------...else {printf "The total cost of this item is $total dollars.\n";print "---------------------------------------...print "---------------------------------------...};}
|