adamwdraper / Numeral-js

A javascript library for formatting and manipulating numbers.
http://numeraljs.com
MIT License
9.65k stars 926 forks source link

Support BigInt in the operators #778

Open ilikejamesdw opened 1 year ago

ilikejamesdw commented 1 year ago

Bit odd that:

> numeral(10n)
{ _input: 10n, _value: 10 }

is fine. And,

> numeral(10n).add('10')
{ _input: 10n, _value: 20 }

is also fine. But,

> numeral(10n).add(10n)
Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions