How Do I round a number to its nearest thousand?
function round($var) { // Round it }
Here's an answer to round up to the next thousand:
abs(round(($a - 500), -3)) . "\n";
500-999 then round to 0 and 1000-1999 round to 1000, etc.
If you want it to start at 1000, then just do
abs(round(($a + 500), -3)) . "\n";
Cheers!