Skip to Content
avatar image
Former Member

How to convert a string value into numeric

Hi dear all,

( sap personas scripit ):

I have this variable credit_e="4,250,000.00" text ,string

n_credit_e = parseInt(credit_e); // is almost working but this function is returning only the integer 4

should be 4,250,000.00 ( as numeric )

Thanks,


Abilio

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 25, 2017 at 11:45 PM
    var credit_e="4,250,000.40";
    
    var n_credit_e=Number(credit_e.replace(/\,/g,''));
    Add comment
    10|10000 characters needed characters exceeded