-
-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
unformat
currently can't parse custom postfixes. And other custom formatting. Even if provided as a format object in the second parameter.
It looks like the format argument is part of the API, but not actually used. It is passed down from unformat
eventually into computeUnformattedValue
, but is not actually used there.
Lines 246 to 253 in 0e58867
/** | |
* Unformat a numbro-generated string to retrieve the original value. | |
* | |
* @param {string} inputString - string to unformat | |
* @param {NumbroFormat} format - format used while generating the inputString | |
* @return {number} | |
*/ | |
function unformat(inputString, format) { |
Expected
const format = { postfix: "test" };
const result = numbro.unformat(numbro(90).format(format), format)
expect(result).toBe(90)
Actual
The result is either NaN
or undefined
.
Metadata
Metadata
Assignees
Labels
No labels