React-number-format: Returns NaN0 with negative numbers between -9.5 and -9.9

Created on 15 Dec 2017  路  2Comments  路  Source: s-yadav/react-number-format

Version: 3.1.2
Will always get NaN zero for numbers mentioned above. Problem seems to stem from this block of code in utils.js:
const intPart = numberParts[0].split('').reverse().reduce((roundedStr, current, idx) => { if (roundedStr.length > idx) { return (Number(roundedStr[0]) + Number(current)).toString() + roundedStr.substring(1, roundedStr.length); } return current + roundedStr; }, roundedDecimalParts[0]);

Most helpful comment

Fixed on v3.1.3

All 2 comments

+1

Fixed on v3.1.3

Was this page helpful?
0 / 5 - 0 ratings