-1
I have a string 123.456.789
and when using parseint is returning 123456
, how to do to return 123456789
?
-1
I have a string 123.456.789
and when using parseint is returning 123456
, how to do to return 123456789
?
3
In this example, I first did the formatting by removing the stitches, then did the conversion.
var numeroFormatado = `123.456.789`.replace(/\./g, ``)
numero = parseInt(numeroFormatado)
console.log(numero)
Exactly, the last point is seen as decimal place in the English language
Browser other questions tagged javascript string int
You are not signed in. Login or sign up in order to post.
Remove the points with replace.
– Sam
Probably it is considering the last point as decimal point and then when you convert to integer it despises the decimal part getting only the whole part.
– anonimo