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

Formating Currency

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-10-2005, 03:18 AM
 
William Hayes William Hayes is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Waterford, Ireland
Posts: 57
 

Default Formating Currency

Hi gang,

I want to be able to format the currency prices so they dont show any decimal placing:

i.e. display "$150" instead of "$150.00"

I've been looking at the Math functions and the currency.tpl file
but still no joy.

Is there a simple fix for this?

W
__________________
Custom xcart Design?
www.brightlight.ie

x-cart 3.x.x
x-cart 4.0.x
Version 4.1.9
Reply With Quote
  #2  
Old 10-10-2005, 04:14 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

I've not tried this, but if it was me, I would be looking at changing the database perhaps.

In the pricing table, you have a price field, which has a type of decimal(12,2); if you changed this to remove the 2, you would then not have any decimal points.

I would do this via phpmyadmin myself, suggest backing it up first though!
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 10-10-2005, 04:50 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Not good for tax reasons though...government doesn't like things rounded off
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 10-10-2005, 05:04 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

no doubt worth a look at currency.tpl too
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 10-11-2005, 03:42 AM
 
William Hayes William Hayes is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Waterford, Ireland
Posts: 57
 

Default

Yep - a very simply fix in the end...

Within the currency.tpl file -
I just removed the

|formatprice:",":"."

from

Code:
{$config.General.currency_symbol}{$value|abs_value|formatprice:",":"."}

That done the trick

W
__________________
Custom xcart Design?
www.brightlight.ie

x-cart 3.x.x
x-cart 4.0.x
Version 4.1.9
Reply With Quote
  #6  
Old 10-14-2005, 02:52 PM
 
tron tron is offline
 

Advanced Member
  
Join Date: Jun 2003
Location: Oslo
Posts: 46
 

Default

Quote:
Originally Posted by William Hayes
Yep - a very simply fix in the end...

Within the currency.tpl file -
I just removed the

|formatprice:",":"."

from

Code:
{$config.General.currency_symbol}{$value|abs_value|formatprice:",":"."}

That done the trick

W


but it also removed the currency symbol.

using 4.0.15
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 03:59 AM.

   

 
X-Cart forums © 2001-2020