I would like to know if anyone can tell me how I delete the decimals from the price of the ads on my site.
I have a free classifieds website, but I can not understand how to delete decimals. I do not need them
For example:
If the price of an object is 100 $ Currently it is shown as 100.00 $
I'm interested in eliminating the last few decimals, so you always have the $ 100 price
I think it's the number_format to change or I do not know, I've tried various changes.
Generally how do you change?
My site is visible here annuncigratuiti.com
$var = number_format($var, 0, '.', '');
echo $var;
but it return as string, to make it as float :
$var = (float)number_format($var, 0, '.', '');