Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPavel Senk
2,717 PointsDecimal point
Hello,
Regarding this practice JavaScript Math with Number, I would like to ask If the user enters an input value with a decimal point, for example 3.14, How can I convert the decimal point from "," to "." (like a converting string to number) if the user enters this value on numeric keyboard => 3,14 instead 3.14?
Is there any option ?
Thank you.
Daniel Jong
11,071 PointsDaniel Jong
11,071 PointsHi, you can use the parseFloat() and replace() method together to achieve it!
By replacing the comma with period, you can then parse the string into a float.
Hope it helps!