Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Extra 00 in price?


vonbrocklin

Recommended Posts

I searched but could not find info on this:

 

When I add a product with a price of 11.95, for example, and then return to edit that product, the price is listed as 11.9500. This does not show up in the store, only in admin. Why is this, and how do I get it to stop?

 

I'm using MS1 with US currency default. Thanks...

Link to comment
Share on other sites

It is set in the database table products > products_price decimal(15,4)

 

The second number governs how many decimal places are stored in the database..... not sure where in the code though for displaying only the two(didn't look). You are better off leaving it as it is as its used in calculating the different currencies when they are updated.

Link to comment
Share on other sites

This is what I don't get though: I DO have it set to show two decimal places and it is doing just that on the consumer side. But on admin it is showing 4 decimal places, which I do not get and find slightly disconcerting. Maybe I am missing something simple but any more clarification on why I get two extra zeros would be appreciated.

Link to comment
Share on other sites

I just read your reply more carefully and realized you were talking about the actual database set-up for that field. This makes more sense now, but it is still annoying to see those extra zeros in the price field. I guess I will just have to get used to this and explain to my clients to ignore them.

Link to comment
Share on other sites

Happens on my store too. One of several peculiarities :)

 

HLT

.

www.hairlosstalk.com

Consumer Hair Loss Information & Support

Link to comment
Share on other sites

look in admin/categories.php

 

look for :

 

          <tr>

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price); ?></td>

         </tr>

 

change to:

          <tr>

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', round($pInfo->products_price,2)); ?></td>

         </tr>

Unexpect the Expected

Link to comment
Share on other sites

  • 1 year later...

Has anyone got this working in MS2?

 

On the admin side I would just like to see 2 decimal places (while the database may still calculate 4 decimal places).

 

I've tried the code given above but does not seem to work on Milestone 2.

 

Any one any help?

 

Thanks!

 

JuJu

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...