fix(parseYBounds): parseYBounds was parsing integers, causing floating numbers to be trimmed. Updated parseYBounds to parseFloat instead (#18166)
parent
ebbc8025b3
commit
b913eea568
|
@ -15,4 +15,7 @@ describe('parseYBounds', () => {
|
|||
it('should return [-10, null] when the bounds are ["-10", null]', () => {
|
||||
expect(parseYBounds(['-10', null])).toEqual([-10, null])
|
||||
})
|
||||
it('should return [0.1, .6] when the bounds are ["0.1", "0.6"]', () => {
|
||||
expect(parseYBounds(['0.1', '0.6'])).toEqual([0.1, 0.6])
|
||||
})
|
||||
})
|
||||
|
|
|
@ -136,8 +136,8 @@ export const parseYBounds = (
|
|||
return null
|
||||
}
|
||||
|
||||
const min = isNaN(parseInt(bounds[0])) ? null : parseInt(bounds[0])
|
||||
const max = isNaN(parseInt(bounds[1])) ? null : parseInt(bounds[1])
|
||||
const min = isNaN(parseFloat(bounds[0])) ? null : parseFloat(bounds[0])
|
||||
const max = isNaN(parseFloat(bounds[1])) ? null : parseFloat(bounds[1])
|
||||
return [min, max]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue