As replace()
creates/returns a new string rather than modifying the original (tt
), you need to set the variable (tt
) equal to the new string returned from the replace
function.
tt = tt.replace(/,/g, '.')
Related Contents:
- Replace multiple strings with multiple other strings
- Replace all non alphanumeric characters, new lines, and multiple white space with one space
- JavaScript .replace only replaces first Match [duplicate]
- JavaScript replace/regex
- How can I replace a regex substring match in Javascript?
- Insert space before capital letters
- JavaScript replace \n with [duplicate]
- Replace a Regex capture group with uppercase in Javascript
- Escape dot in a regex range
- jQuery remove special characters from string and more
- remove last directory in URL
- RegEx for match/replacing JavaScript comments (both multiline and inline)
- Javascript replace method, replace with “$1”
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- How do I split a string with multiple separators in JavaScript?
- Escape string for use in Javascript regex [duplicate]
- How to remove all line breaks from a string
- How to trim a file extension from a String in JavaScript?
- Split large string in n-size chunks in JavaScript
- How to make Regular expression into non-greedy?
- Converting any string into camel case
- Concrete JavaScript regular expression for accented characters (diacritics)
- Convert camelCaseText to Title Case Text
- Match exact string
- How can I concatenate regex literals in JavaScript?
- Negative lookbehind equivalent in JavaScript
- Create RegExps on the fly using string variables
- Regular Expression: Any character that is not a letter or number
- What does the regex \S mean in JavaScript? [duplicate]
- Check if a string is html or not
- How to capture an arbitrary number of groups in JavaScript Regexp?
- JS regex to split by line
- Javascript Regular Expressions – Replace non-numeric characters
- Regex to extract substring, returning 2 results for some reason
- jQuery javascript regex Replace with \n
- javascript – replace dash (hyphen) with a space
- Regular Expression: Allow letters, numbers, and spaces (with at least one letter or number)
- Why do regex constructors need to be double escaped?
- Removing all script tags from html with JS Regular Expression
- How to loop all the elements that match the regex?
- Negative lookahead Regular Expression
- RegEx – Get All Characters After Last Slash in URL
- String.Replace only replaces first occurrence of matched string. How to replace *all* occurrences?
- How can I match overlapping strings with regex?
- Javascript Regexp – Match Characters after a certain phrase
- Replacing accented characters with plain ascii ones [duplicate]
- Is it possible to replace all carriage returns in a string via .replace?
- Convert dash-separated string to camelCase?
- How to insert space every 4 characters for IBAN registering?
- jQuery Youtube URL Validation with regex