OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to allow german user to enter numbers in german format in React JavaScript

  • Thread starter Thread starter Anand
  • Start date Start date
A

Anand

Guest
We are developing application which should support both German and English users.

What can we do to allow German users to enter numbers in German format (, as decimal point and . as thousand separator), and moment he tab out from input box, we should be able to convert input text into JavaScript number, Right now when we use Number() function it gives us the NaN for Number("12,23")

We are able to convert English text to German format number using new Intl.NumberFormat() but it is vice versa which we want.

<p>We are developing application which should support both German and English users.</p>

<p>What can we do to allow German users to enter numbers in German format (, as decimal point and . as thousand separator), and moment he tab out from input box, we should be able to convert input text into JavaScript number,
Right now when we use Number() function it gives us the NaN for <code>Number("12,23")</code></p>

<p>We are able to convert English text to German format number using new <code>Intl.NumberFormat()</code> but it is vice versa which we want.</p>
 

Latest posts

Top