How Do I round a number to its nearest thousand?
function round($var) {
// Round it
}
Use the round function as mentioned by other posters round($number, -3).
You can also, divide your number by 1,000, round to nearest whole number then multiply by 1,000.
Also, if you want to round up, you can divide by 1,000, negate the quotient, coerce it to an integer, negate it again and then multiply it by 1,000.