-2

I want to replace the dot in a number in Javascript with regular expression; if country_temp is, for example, 1.234, how can I put the value 1234 in country_temp2? I have tried the following:

const country_temp2 = country_temp.replace(/[a-zA-Z]*\**\s*\./g, "")
but it's not working.

Edit: the original string is composed by characters, asterisk, a number and a dot Sorry, but I have written in a very fast way.

user1
  • 556
  • 2
  • 6
  • 22

1 Answers1

0

Try this:

country_temp.replace(/\./g,'')
mstoJS
  • 119
  • 1
  • 6