X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Remove decimals in prices (https://forum.x-cart.com/showthread.php?t=66430)

Latat 03-17-2013 10:48 AM

Remove decimals in prices
 
Hi,

I am testing now 4.5.4 and would like to remove the decimal places in price. Where I can do it?
Example: 5 EUR price instead of 4.97 EUR.
Both for primary and secondary pricing.

Thanks!

cflsystems 03-17-2013 11:08 AM

Re: Remove decimals in prices
 
Well you can't. There is no setting for this. You can modify templates to show rounded price but this will only show the price like this, it will not use it rounded. You will have to modify in php how the proces are calculated and used. I think there is no one place to do this...

Latat 03-20-2013 05:09 PM

Re: Remove decimals in prices
 
Well, I found out the solution, it is more simplier as I thought.
No need to do any PHP modification.

Solution: in SQL set in the xcart_config "number_format" the value from 2,. to 0,. If you need more decimals, you can change 2 to any numbers you want to see as decimals.

This can be used for currencies where not used any decimals.
In this case: 3200.00 will be changed to 3200 if you use the modification I described above. The change is automatic rounding that means if you have a decimal, like 100.56 that will be rounded to 101. So it is not truncate function only...

cflsystems 03-20-2013 09:13 PM

Re: Remove decimals in prices
 
If it works for you that way...


All times are GMT -8. The time now is 02:01 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.