Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Remove decimals in prices

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-17-2013, 10:48 AM
 
Latat Latat is offline
 

Member
  
Join Date: Aug 2005
Location: Hungary
Posts: 25
 

Default 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!
Reply With Quote
  #2  
Old 03-17-2013, 11:08 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 03-20-2013, 05:09 PM
 
Latat Latat is offline
 

Member
  
Join Date: Aug 2005
Location: Hungary
Posts: 25
 

Default 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...
__________________
Latat
X-cart Gold 4.019, LINUX
Reply With Quote
  #4  
Old 03-20-2013, 09:13 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Remove decimals in prices

If it works for you that way...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:54 AM.

   

 
X-Cart forums © 2001-2020