Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

two '0's instead of four in PRICE after ","


Darklings

Recommended Posts

Hi all,

 

 

Can soemeone help me with a little php? I got this line to show the price (i put that in my checkout_confirmation.php page as additional info).

But its showing me the price with 4 '0' after , - for ex. 15,0000EUR

I want it to show only 15,00EUR

 

 

The line i already got:

echo '            <td class="main" align="center" width="50">€ ' . $order->products[$i]['price'] . ' </td>' . "\n";

 

 

Thnx in advance for answers :D

 

Kind Regards,

Tom

Even in this dark place, yes, I am afraid of my own shadow.

 

 

 

Contributions | KnowledgeBase | osCommerce 2.2 pdf

Link to comment
Share on other sites

When you add/edit the currency in your osC admin panel you get the option of stating how many decimal places. If you only want two then just add 2 to the decimal places box.

 

Vger

Link to comment
Share on other sites

When you add/edit the currency in your osC admin panel you get the option of stating how many decimal places.  If you only want two then just add 2 to the decimal places box.

 

Vger

 

 

Yeah - thought someone would give that as explanation >.<

Well, i have it set as 2 in my oscAdmin pannel.

Ex.

 

Title: Euro

Code: EUR

 

Symbol Left:

Symbol Right: EUR

 

Decimal Point: .

Thousands Point: ,

Decimal Places: 2

 

Last Updated: 02/25/2005

Value: 1.00000000

 

Example Output:

30.00EUR = 30.00EUR

 

 

Thats why I explained how I used it.

through whole my site its showing like this - correct.

But I am customizing the way the checkout_confirmation.php looks like - to make it clearer for the customers. But I added an extra column there to show the customers what the price for one was (withouth just showing the total price (price for one x qty)).

 

To do that I just put the folowing code in a new row i added to the table:

 

echo '            <td class="main" align="center" width="50">€ ' . $order->products[$i]['price'] . ' </td>' . "\n";

 

But this price shows up with 4decimal Places - instead of the 2 i gave in.

 

Can someone help me pls?

 

Thnx,

Kind Regards,

Tom

 

(IF more code is needed OR screenshots => I will be more then happy to provide them :D)

Even in this dark place, yes, I am afraid of my own shadow.

 

 

 

Contributions | KnowledgeBase | osCommerce 2.2 pdf

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...