I'm gonning to complete what David Thomas wrote.
1/ Create a custom module with the code. Replace My_Module by the name of your module.
/**
* hook_commerce_currency_info_alter
*
* Add custom currency format to selected currencies
*/
function MY_MODULE_commerce_currency_info_alter(&$currencies){
$currencies['IRR']['format_callback'] = 'MY_MODULE_commerce_currency_format';
}
/**
* Currency format callback
*
* Remove decimal places from output
* while keeping commerce_amount_to_decimal formatting the same
*
* See: commerce_currency_format
*/
function MY_MODULE_commerce_currency_format($amount, $currency, $object = NULL, $convert = TRUE) {
// Format the price as a number.
// In our case, we remove decimal places
$price = number_format(commerce_currency_round(abs($amount), $currency), 0, $currency['decimal_separator'], $currency['thousands_separator']);
// Establish the replacement values to format this price for its currency.
$replacements = array(
'@code_before' => $currency['code_placement'] == 'before' ? $currency['code'] : '',
'@symbol_before' => $currency['symbol_placement'] == 'before' ? $currency['symbol'] : '',
'@price' => $price,
'@symbol_after' => $currency['symbol_placement'] == 'after' ? $currency['symbol'] : '',
'@code_after' => $currency['code_placement'] == 'after' ? $currency['code'] : '',
'@negative' => $amount $currency['symbol_spacer'],
'@code_spacer' => $currency['code_spacer'],
);
return trim(t('@code_before@code_spacer@negative@symbol_before@price@symbol_spacer@symbol_after@code_spacer@code_after', $replacements));
}
2/ Go to Custom Currency Setting (admin/commerce/config/currency/custom-settings) and setup the field Format Callback with: My_Module_ommerce_currency_format
At this point your node will display what you asked, but not your views (or your fields).
3/ To use this setting into your views display, you have to display the node inside your views. If you display a field it won't work. Views > Show: Content
Cheers