autoNumeric icon indicating copy to clipboard operation
autoNumeric copied to clipboard

Digital group spacing behavior

Open titamrtn opened this issue 3 years ago • 1 comments

Current behavior

I've instantiate AutoNumeric like the doc said

AutoNumeric('#formelement', {
    allowDecimalPadding : false,
    digitGroupSeparator : ' ',
    digitalGroupSpacing : '2',
});

When i type : 3359893660 the output is : 3 35 98 93 660

Expected behavior

Since Group spacing is '2' i've expected that the output shoud be 33 59 89 36 60

Version used: v4.5.4

titamrtn avatar Jan 17 '22 12:01 titamrtn

Indeed, this is a bug. The faulty behavior is shown in this example with version 4.6.0.

AlexandreBonneau avatar Jan 18 '22 06:01 AlexandreBonneau

Ok this is not a bug, but the way numbers are grouped for India's Lakh. However as said here it's better to use 2 to group by 2, and 2t to group by 2 and 3 groups.

AlexandreBonneau avatar May 17 '23 20:05 AlexandreBonneau