|
So I am having this problem where when I try to use printf to output a number with a single decimal place it tacks on an extra 0, but when I use sprintf to load the value into a variable then print out that variable it works fine. Below is the working code, I didn't save the non-working code:
$val = ($offices{$office}{'opened'} / $offices{$office}{'sent'}) * 100;
$val = sprintf ("%.1f", $val);
print OUTPUTFILE"$val\t";
Thanks
|
|
|
|
|
|
|
// |