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

Round Japanese prices
 
Loic_LC
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2007-12-19
Paris, France
 

Hello,
I have a store with euro & yen.
I needed the yen (and only the yen) to be rounded, because there are no decimals in this currency.
A coder made a file for me, and that works great in the front end.
I’m posting here the file, hoping it could help someone who needs it, and may be you could make it so it works also in the backend because I need it.

it is located in
app/code/community/(yourCustomName)/(yourCustomName)/Model/Core/Store.php

File Attachments
Store.php  (File Size: 4KB - Downloads: 404)
 
Magento Community Magento Community
Magento Community
Magento Community
 
JeffGay
Moderator
 
Avatar
Total Posts:  18
Joined:  2013-07-04
Yokohama, JAPAN
 

There are at least two changes required for whole number currencies in Magento Community (1.7.*)
1) Correct the display of currencies to format to whole numbers. The formatting happens in core/Mage/Mode/Currency.php.
See function format(), which calls formatPrecision( $price, 2 , $options, $includeContainer, $addBrackets );
2) Correct the rounding or all calculations, i.e. totals, taxes, discounts, etc. The rounding happens in core/core/Mage/Core/Model/Store.php
See function roundPrice(), which calls round( $price, 2 );

There may be more changes required for supporting more than one currency.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top