Answers for "js remove dollar sign from string"

0

js remove dollar sign from string

A common problem with HTML input forms is that users tend to include dollars signs when inputting currency numbers.
These dollars signs can be easily removed through JavaScript by using the JavaScript replace function and a simple regular expression.
This is demonstrated in the following example:

var Amount = '$13.22';
var ReplacedAmount = Amount.replace(/\$/g,'');
document.write(ReplacedAmount);
Posted by: Guest on June-28-2021

Code answers related to "js remove dollar sign from string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language