Add thousands decimal dot in input field while typing

By

•

min read

My profile

Share this:
input-> onkeyup="oneDot(this)"

  function oneDot(input) {
    var value = input.value,
        value = value.split('.').join('');

    if (value.length > 3) {
      value = value.substring(0, value.length - 3) + '.' + value.substring(value.length - 3, value.length);
    }

    input.value = value;
  }

https://stackoverflow.com/questions/32759353/how-to-get-automatic-dots-in-number-input

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *