You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #590, I came across ambiguities in the unformatter.
Initially, I tried to use B as the abbreviation for "trillion", as that would be "Billion" in German. This, however, made some tests fail, as B is also a valid postfix in the byte unformatter, representing bytes.
Obviously, numbro cannot solve this problem completely, as strings like "1B" are inherently ambiguous in German. To migitate the problem, however, it would be possible to:
define an order of execution/precedence on the formatters (which kind of formatted number does the unformatter try to recognize first/second/...?) and add this to the docs (http://numbrojs.com/format.html#unformat)
make the unformatter take a second argument specifying the type of value in question (number, currency, byte, etc.)
The text was updated successfully, but these errors were encountered:
I don't think the two approaches are mutually exclusive. Having a unformat function that only takes the input as argument might be useful where the someone has no clue about what kind of numeric thing has been input. We should just make sure the user knows what he can expect from that function.
Anyways, I am sorry I probably won't have time to tackle this (as a matter of fact, I only came here because I need that language file fix two layers up the stream...).
While working on #590, I came across ambiguities in the unformatter.
Initially, I tried to use
B
as the abbreviation for "trillion", as that would be "Billion" in German. This, however, made some tests fail, asB
is also a valid postfix in the byte unformatter, representing bytes.Obviously, numbro cannot solve this problem completely, as strings like "1B" are inherently ambiguous in German. To migitate the problem, however, it would be possible to:
The text was updated successfully, but these errors were encountered: