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
I am using go-humanize for some backend code and BenjaminVanRyseghem/numbro for frontend code. Unfortunately, these libraries have slightly different semantics when humanizing numbers, resulting in different reports depending on where data is processed.
For example, go-humanize always omits sub-whole digits when applying SIWithDigits(input, 1, units), while numbro(input).format('0.0a') always keeps sub-hole digits.
I have asked numbro to make trailing .0 optional in the output. That would at least match how go-humanize behaves.
Meanwhile, it would also be helpful for go-humanize to provide an option to keep sub-hole digits in SI text, as another way to get these libraries working in sync.
The text was updated successfully, but these errors were encountered:
Hi,
I am using go-humanize for some backend code and BenjaminVanRyseghem/numbro for frontend code. Unfortunately, these libraries have slightly different semantics when humanizing numbers, resulting in different reports depending on where data is processed.
For example, go-humanize always omits sub-whole digits when applying
SIWithDigits(input, 1, units)
, whilenumbro(input).format('0.0a')
always keeps sub-hole digits.BenjaminVanRyseghem/numbro#434
I have asked numbro to make trailing
.0
optional in the output. That would at least match how go-humanize behaves.Meanwhile, it would also be helpful for go-humanize to provide an option to keep sub-hole digits in SI text, as another way to get these libraries working in sync.
The text was updated successfully, but these errors were encountered: