]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Extension ext-surfbar continued, fixes:
[mailer.git] / inc / wrapper-functions.php
index 564ee853e3dbe4ce6d0d11215ecfbb7eb16f62b2..a89c49a676972c42d106c7e4548a8e29a71e84f3 100644 (file)
@@ -2537,6 +2537,26 @@ function convertCommaToDotInPostDataArray ($postEntries) {
        } // END - foreach
 }
 
+/**
+ * Parses a string into a US formated float variable, taken from user comments
+ * from PHP documentation website.
+ *
+ * @param      $floatString    A string holding a float expression
+ * @return     $float                  Corresponding float variable
+ * @author     chris<at>georgakopoulos<dot>com
+ * @link       http://de.php.net/manual/en/function.floatval.php#92563
+ */
+function parseFloat ($floatString){
+    $LocaleInfo = localeconv();
+    $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '', $floatString);
+    $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString);
+    return floatval($floatString);
+}
+
+//-----------------------------------------------------------------------------
+//                        Configuration wrapper
+//-----------------------------------------------------------------------------
+
 // Getter for 'check_double_email'
 function getCheckDoubleEmail () {
        // Is the cache entry set?
@@ -2549,7 +2569,7 @@ function getCheckDoubleEmail () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// Checks wether 'check_double_email' is "YES"
+// Checks wether 'check_double_email' is 'Y'
 function isCheckDoubleEmailEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {