Fixed rounding issues where raw value was added instead of rounded, fixes #815
This commit is contained in:
parent
1b32910002
commit
1f677569eb
@ -800,7 +800,7 @@ var Chartist = {
|
||||
for (i = bounds.min; i <= bounds.max; i = safeIncrement(i, bounds.step)) {
|
||||
var value = Chartist.roundWithPrecision(i);
|
||||
if (value !== values[values.length - 1]) {
|
||||
values.push(i);
|
||||
values.push(value);
|
||||
}
|
||||
}
|
||||
bounds.values = values;
|
||||
|
||||
@ -421,7 +421,7 @@ describe('Chartist core', function() {
|
||||
expect(bounds.max).toBe(1000);
|
||||
expect(bounds.low).toBe(999.9999999999997);
|
||||
expect(bounds.high).toBe(1000.0000000000001);
|
||||
expect(bounds.values).toEqual([999.9999999999999]);
|
||||
expect(bounds.values).toEqual([Chartist.roundWithPrecision(999.9999999999999)]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user