regex - javascript : parse float with string prefix in both start and end -
how convert string float? want result 900.50
case-1: var convertthis = 'any string here 900,50 string here';
case-2: var convertthis = 'any string here 900.50 string here';
how this?
var myfloat = +(convertthis.match(/\d+[,\.]?\d+/)[0].replace(",","."))
Comments
Post a Comment