Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

Fixed Notification Format Price (#884)

Louisf51420799dbd
diff --git a/endpoints/cronjobs/sendnotifications.php b/endpoints/cronjobs/sendnotifications.php
index 40f0474..8970b49 100644
--- a/endpoints/cronjobs/sendnotifications.php
+++ b/endpoints/cronjobs/sendnotifications.php
@@ -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;