Ticket #477 (closed defect: fixed)

Opened 14 months ago

Last modified 14 months ago

Bug when entering a decimal value in IE if 'number of decimals' is set to 0

Reported by: sdm Owned by: mpo
Priority: major Milestone: 0.4
Component: modules/kauri-forms Version:
Keywords: Cc:

Description

If the Windows language setting "number of decimals" is set to 0, a bug occurs when entering a decimal value in a decimal field.

Eg. 5 becomes 1, 90 becomes 1

This can be reproduced by running the Kauri-testPage in IE after changing the Windows language setting "number of decimals" to 0.

The problem is caused by the method getDecimalSeparator() in core.js:

$.getDecimalSeparator = function() {
    var n = 1.1;
    n = n.toLocaleString().substring(1, 2);
    return n;
};

In this case, n.toLocaleString() doesn't contain a decimal separator, so n becomes "".

Change History

comment:1 Changed 14 months ago by sdm

  • Status changed from new to closed
  • Resolution set to fixed

In [1961]:

core.js: getDecimalSeparator() now returns a default separator in case no decimal separator was found. This fixes #477

Note: See TracTickets for help on using tickets.