* @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);
+ // Load locale info
+ $LocaleInfo = localeconv();
+
+ // Remove thousand separators
+ $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '' , $floatString);
+
+ // Convert decimal point
+ $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString);
+
+ // Return float value of converted string
+ return floatval($floatString);
}
// Generates a YES/NO option list from given default