Skip to content

Does not work for input type numbers #16

Description

@vimkaf

whenever i format <input type="number" /> I get the error

The specified value "1,212" cannot be parsed, or is out of range
This is my JS code

const cleaveZen = window.cleaveZen;
const { formatNumeral } = cleaveZen;

const currencyInputs = document.querySelectorAll(".currencymask");

currencyInputs.forEach((currencyInput) => {
  currencyInput.addEventListener("input", (e) => {
    currencyInput.value = formatNumeral(e.target.value, {
      numeralThousandsGroupStyle: "thousand",
    });
  });
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions