Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
how to remove decimal place? 
 
xiaolin
Member
 
Total Posts:  47
Joined:  2008-05-04
 

hi

anyone can tell me how to remove the decimal place with USD currency?

thanks a lot

 
Magento Community Magento Community
Magento Community
Magento Community
 
xiaolin
Member
 
Total Posts:  47
Joined:  2008-05-04
 

no one knows

 
Magento Community Magento Community
Magento Community
Magento Community
 
xiaolin
Member
 
Total Posts:  47
Joined:  2008-05-04
 

magento team can someone answer me?

 
Magento Community Magento Community
Magento Community
Magento Community
 
xiaolin
Member
 
Total Posts:  47
Joined:  2008-05-04
 

Bump **

 
Magento Community Magento Community
Magento Community
Magento Community
 
liotropi
Sr. Member
 
Total Posts:  182
Joined:  2008-02-21
Athens, Greece
 

hi, since noone has answered - I think I read somewhere that the only way to
do this is with the database
hope it helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
xiaolin
Member
 
Total Posts:  47
Joined:  2008-05-04
 

thanks for pointing me out at least i know that there’s someone here answer me, but hope someone knows the solution

 
Magento Community Magento Community
Magento Community
Magento Community
 
starchild
Member
 
Total Posts:  37
Joined:  2008-07-10
 

Has anyone worked this out yet?  Japanese yen does not have cents!

 
Magento Community Magento Community
Magento Community
Magento Community
 
KrishKusuma
Jr. Member
 
Total Posts:  7
Joined:  2008-07-03
 

I need to remove the decimals too.
We all need help from someone…

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiaraweb
Guru
 
Avatar
Total Posts:  721
Joined:  2008-03-21
Aviano ~ Italy
 

Hi

I resolved in this way

go to the database, and find the field you want change (es: price) change the attribute of the field from decimals to integer (INT)

I used this way to show up in the frontend the number of items instock and it’s works

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
starchild
Member
 
Total Posts:  37
Joined:  2008-07-10
 

I just tried this and all my list view prices went to 0.00!

argghhh!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MOdMac
Jr. Member
 
Total Posts:  4
Joined:  2007-09-12
 

I don’t think changing the schema is the way to solve this problem. 
You just need to change the precision for the locale you are using.
I added this after the app has been started and before Mage:run :

// remove cents from japans locale
Mage::app()->getLocale()->currency('JPY')->setPrecision(0);
 
Magento Community Magento Community
Magento Community
Magento Community
 
matobarros
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-10-13
Santiago, Chile
 

I just saw this in another post:

Change line 62 in Currency.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
squirrels
Sr. Member
 
Total Posts:  93
Joined:  2008-08-27
 

If someone else is looking for the right Currency.php it is located in lib/Zend (there are 10 Currency.php-files in my Magento installation) smile

But I would prefer to change this per currency and not globally

@MOdMac – where do I do the change you are suggesting?
I would also like to change the currency code and the thousand separator symbol (or rather take it away) - is that done in the same file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Frederik Krautwald
Member
 
Avatar
Total Posts:  58
Joined:  2007-09-25
Reykjavík, Iceland
 
MOdMac - 13 July 2008 05:29 PM

I don’t think changing the schema is the way to solve this problem. 
You just need to change the precision for the locale you are using.
I added this after the app has been started and before Mage:run :

// remove cents from japans locale
Mage::app()->getLocale()->currency('JPY')->setPrecision(0);

Produces the following error:

Fatal error: Call to undefined method Mage_Core_Model_Locale_Currency::setPrecision()

 
Magento Community Magento Community
Magento Community
Magento Community
 
sktung
Jr. Member
 
Total Posts:  15
Joined:  2008-09-25
 

Modifying the currency.php precision setting in \lib\zend works but unfortunately it affects all the currencies used on that particular Magento Installation.

Is there any way to do this so it sets precision based on the currently selected currency? Ideally, without modifying the core files..

This is obviously a huge issue as the majority of Asian currencies do not have cents.

-Stephen

 
Magento Community Magento Community
Magento Community
Magento Community
 
Loic_LC
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2007-12-19
Paris, France
 

I agree. I’m also interested in setting precision for decimal depending on currency.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3