Cleave.js: Cleave Int input

Created on 26 Jan 2017  路  3Comments  路  Source: nosir/cleave.js

Hi, is there a way of making Cleave use integers only?

No delimiter or decimals

Most helpful comment

Yea, exactly, just as @tiagomatosweb posted, pass empty string to numeralDecimalMark and delimiter.
Will close this for now, thanks for playing with it.

All 3 comments

I came across with this

new Cleave('.int', {
                numeral: true,
                numeralDecimalMark: '',
                delimiter: '',
            });

But I'd like to know how to delimiter with just 2 character.

That is actually simple

new Cleave('.int', {
   blocks: [2],
   numericOnly: true,
});

In your case would be something like

new Cleave('.int', {
  numeral: true,
  numeralDecimalMark: '',
  delimiter: '',
});

Yea, exactly, just as @tiagomatosweb posted, pass empty string to numeralDecimalMark and delimiter.
Will close this for now, thanks for playing with it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaileshrathod128 picture shaileshrathod128  路  6Comments

d3bgger picture d3bgger  路  4Comments

vfonic picture vfonic  路  3Comments

ozkxr picture ozkxr  路  3Comments

qm3ster picture qm3ster  路  4Comments