I can't seem to comprehend what is happening with sprintf() and I just end up getting a bunch of "%" and zeros.
I've come up with a temporary solution that may be adequate...even if it's not right.
$tempval=floatval($m); // the offending string...typically in scientific notation
$chopped=substr($tempval,0,8); //hack to get past scientific notation. (the string is typically about 17 characters long....way more precise than needed for the display.
$fm=number_format(round($chopped, 3),3); // rounded/formatted number
I'll keep trying to do it "correctly" but I needed something in place for end of schoolyear reporting.