Hi folks,
When calculating a golf handicap differential you are supposed to truncate the answer to 1 decimal place without rounding. No idea why but...
I know how to do this using TRUNCATE() in mySQL
SELECT TRUNCATE( 2.365, 1 );
// outputs 2.3
but I was wondering if sprintf() could do this? The only way I know to work with decimal places in a float is ...
echo sprintf("%.1f", 2.365);
// outputs 2.4
TIA
JG