Fix number parsing for empty strings

Fixes #7
This commit is contained in:
Michael Jackson 2016-08-09 09:37:48 -07:00
parent 69705d7bb9
commit f1a3ecf997
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ export const formatNumber = (n) => {
}
export const parseNumber = (s) =>
parseInt(s.replace(/,/g, ''), 10)
parseInt(s.replace(/,/g, ''), 10) || 0
export const formatPercent = (n, fixed = 1) =>
String((n.toPrecision(2) * 100).toFixed(fixed))