-1

I get a number format string from an input box like: 1,033.00 How can I convert it to 1033 by jquery/javascript? I have to use this converted number to add it with another number.

0

1 Answer 1

0

You can do a string replace numberString= numberString.replace ( /[^0-9]/g, '' );

To add it to another number you can use + operator to convert the numberString to a number value.

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.