For some reason this brings back 1.00% instead of 100%. I know I could multiply 50 to have 100 and maybe go about that way but the number of questions may change so I need to find out their percentage from the number right to the number of total questions.my $percent = $answers_correct / 50; $percent = sprintf("%.2f", $percent); print "You scored $percent%";
What am I doing wrong?
In reply to decimal isn't truncating by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |