Jump to content

2 decimal places in unit price


wahmkow

Recommended Posts

Hi everyone!

I would like to limit the number of decimal places to only 2 for the unit price on the product page. Currently there are 6 decimal places shown.

Since only the price-ratio is stored in the database, the numbers resulting for the unit price look e.g. like 5.500002 - which does not make a lot of sense to me.

In the code I found that the priceFormater is used on the unit_price  (class ProductLazyArray line 669 call of function format). However I suspect that the unit_price has the currency symbol already appended. This makes it a string and the priceFormatter does not do anything with it anymore.

Are the 6 decimal places intended or is this a bug? 

Using PS 1.7.6.1

Thanks for any suggestions!

Jörg

 

Link to comment
Share on other sites

5 hours ago, wahmkow said:

Hi everyone!

I would like to limit the number of decimal places to only 2 for the unit price on the product page. Currently there are 6 decimal places shown.

Since only the price-ratio is stored in the database, the numbers resulting for the unit price look e.g. like 5.500002 - which does not make a lot of sense to me.

In the code I found that the priceFormater is used on the unit_price  (class ProductLazyArray line 669 call of function format). However I suspect that the unit_price has the currency symbol already appended. This makes it a string and the priceFormatter does not do anything with it anymore.

Are the 6 decimal places intended or is this a bug? 

Using PS 1.7.6.1

Thanks for any suggestions!

Jörg

 

You can set the number of the decimal places here...

decimal.thumb.JPG.ab5483f467375d21ca921b54d2599da9.JPG

Never seen it with more than 2!

Best regards

Link to comment
Share on other sites

Hi PCQUATRO,

yes that setting is at 2 in my store too. But it has no effect for the unit price. I guess it is really a bug.

Problem is not with the template. Same output shows in the classic template. Must be somewhere in the code. Still searching ... 😞

Best regards

Link to comment
Share on other sites

30 minutes ago, wahmkow said:

Hi PCQUATRO,

yes that setting is at 2 in my store too. But it has no effect for the unit price. I guess it is really a bug.

Problem is not with the template. Same output shows in the classic template. Must be somewhere in the code. Still searching ... 😞

Best regards

Try disabling all extra modules and go on from there..

extramodules.thumb.JPG.3632e1fdfe5b6f9920726678ade44738.JPG

Have you checked the currencies page!?

defaultcurrency.thumb.JPG.1dd5d8ed66f6a685d22f05fddcb36e03.JPG

Best Regards

Edited by PCQUATRO (see edit history)
Link to comment
Share on other sites

  • 4 months later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...