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);
}