is there any way to convert a string like "7,1"
into a number and keep the commas after the conversion?.
I’ve tried parseInt but that will ignore everything after the first value. Is there another way around it?
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
You can’t keep commas when you convert them to numbers, however you can use
.join()
method on JS Arrays. Here is how you can do it.