mirror of
https://github.com/ellite/Wallos.git
synced 2025-12-23 23:18:07 -05:00
Fixed Notification Format Price (#884)
Fixed notification formatPrice which would blindly remove the 4th character Ensure there is a space between the Symbol and the Value
This commit is contained in:
@@ -41,9 +41,9 @@ function formatPrice($price, $currencyCode, $currencySymbol)
|
||||
{
|
||||
$formattedPrice = CurrencyFormatter::format($price, $currencyCode);
|
||||
|
||||
if (strstr($formattedPrice, $currencyCode)) {
|
||||
$formattedPrice = str_replace($currencyCode, $currencySymbol, $formattedPrice);
|
||||
$formattedPrice = substr_replace($formattedPrice, "", 3, 1);
|
||||
if (strpos($formattedPrice, $currencyCode) !== false) {
|
||||
$formattedPrice = str_replace($currencyCode, $currencySymbol . ' ', $formattedPrice);
|
||||
$formattedPrice = preg_replace('/\s+/', ' ', $formattedPrice);
|
||||
}
|
||||
|
||||
return $formattedPrice;
|
||||
|
||||
Reference in New Issue
Block a user