Javascript:
function floatval(mixed_var) { // + original by: Michael White (http://crestidg.com)
// % note 1: The native parseFloat() method of JavaScript returns NaN when it encounters a string before an int or float value.
return (parseFloat(mixed_var) || 0);
}
Примеры:
floatval('150.03_page-section');
150.03
|
|
|
|