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)
-   -   Formating Currency (https://forum.x-cart.com/showthread.php?t=17178)

William Hayes 10-10-2005 03:18 AM

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

pauldodman 10-10-2005 04:14 AM

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!

balinor 10-10-2005 04:50 AM

Not good for tax reasons though...government doesn't like things rounded off :)

shan 10-10-2005 05:04 AM

no doubt worth a look at currency.tpl too

William Hayes 10-11-2005 03:42 AM

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

tron 10-14-2005 02:52 PM

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


All times are GMT -8. The time now is 01:46 AM.

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