I want to extract decimal number 265.12 or 0.0 from alphanumeric string (say amount) having value $265.12+ or $265.12- or
265.12
0.0
$265.12+
$265.12-
use :
var str = parseFloat("$265.12".match(/[\d\.]+/)) alert(str % 1); => 0.12000000000000455