[英]How to show 2 digits after comma on CS-CART when decimals in currency set to 4?
为了准确计算增值税,我们的网上商店将币种设置为逗号后显示4位数字。 如何在商店中仅显示2位数字,但是在管理面板中的逗号后设置4位数字时继续计算增值税。 现在显示如下:€23.1621,需要为€23.16
先感谢您
您是否尝试过round()函数?
echo round(price, 2);
这取决于版本。
在4.1.x版本中,您可以尝试修改“ smarty_modifier_format_price”功能( app / functions / smarty_plugins / modifier.format_price.php )
改变这个
$value = fn_format_rate_value($price, $number_type, $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
这样
$value = fn_format_rate_value($price, $number_type, 2, $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.