I know that this is a simple question, but I am relatively new to perl.
Here is the scalar that I have:
$average = $sum/$numhits; # this the average rating
Sometimes the decimals go on forever, like 7.66666666667. How would I go about rounding the $average scalar to only the first to decimal places, like this 7.67?
Here is the scalar that I have:
Code:
# Calculate the average rating $average = $sum/$numhits; # this the average rating
Sometimes the decimals go on forever, like 7.66666666667. How would I go about rounding the $average scalar to only the first to decimal places, like this 7.67?