javascript - How to replace comma and point from a string -


this question has answer here:

i number format string input box like: 1,033.00 how can convert 1033 jquery/javascript? have use converted number add number.

you can string replace numberstring= numberstring.replace ( /[^0-9]/g, '' );

to add number can use + operator convert numberstring number value.

var numberstring= numberstring.replace ( /[^0-9]/g, '' ); var addition = +numberstring + anothernumber;


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -