How do I round larger numbers in php.
NOTE: I have aready tried the round function and can not seem to get it to work as i need
for example:
Say i have 4 listing in a database and they have 4 different prices.
1st Price = 5,783
2nd Price = 19,647
3rd Price = 12,867
4th Price = 23,647
Now we determin that the lowest price in the databae would be 5,783
and the highest price is 23,647.
now what i want to do is round down the lowest price to say the nearest 500 or 1000 or even 5000
example of nearset 1000
lowest price 5,783 rounded down = 5000
highest price 23,647 rounded up = 24000
You can use this function:
Call it like this:
Similar functions, but when you want to decide for yourself in which direction to round: