]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
- Major change in menu system. You need to rewrite/update your member and guest
[mailer.git] / inc / functions.php
index 59e8c8c4a9d556b0bdd13fc09e0daa10003af04b..cc64df1b28519495857eed577b0e920cf0128865 100644 (file)
@@ -2420,7 +2420,26 @@ function CONVERT_SELECTIONS_TO_TIMESTAMP(&$POST, &$DATA, &$id, &$skip) {
 }
 // Reverts the german decimal comma into Computer decimal dot
 function REVERT_COMMA ($str) {
-       $float = (float)str_replace(",", ".", $str);
+       // Default float is not a float... ;-)
+       $float = false;
+
+       // Which language is selected?
+       switch (GET_LANGUAGE()) {
+               case "de": // German language
+                       // Remove german thousand dots first
+                       $str = str_replace(".", "", $str);
+
+                       // Replace german commata with decimal dot and cast it
+                       $float = (float)str_replace(",", ".", $str);
+                       break;
+
+               default: // US and so on
+                       // Remove thousand dots first and cast
+                       $float = (float)str_replace(",", "", $str);
+                       break;
+       }
+
+       // Return float
        return $float;
 }
 //