Skip to content

Commit

Permalink
fix: add unit tests fot checking parseFloat with thousands separator
Browse files Browse the repository at this point in the history
  • Loading branch information
taopkorczak committed Jun 12, 2024
1 parent 05b2ebc commit ba59cb5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/util/locale/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,16 @@ define([
})
.then(ready);
});

QUnit.test('parseFloat with thousands separator in decimal part', assert => {
locale.setConfig({
decimalSeparator: '.',
thousandsSeparator: ','
});

assert.equal(locale.parseFloat('3,14'), 3.0, 'float with thousands separator in decimal part should be parsed as integer 3');
assert.equal(locale.parseFloat('34,1'), 34.0, 'float with thousands separator in decimal part should be parsed as integer 34');
assert.equal(locale.parseFloat('3,123'), 3123.0, 'integer part with thousands separator should be parsed correctly as 3123');
assert.equal(locale.parseFloat('23,123'), 23123.0, 'integer part with thousands separator should be parsed correctly as 23123');
});
});

0 comments on commit ba59cb5

Please sign in to comment.