vue-currency-input icon indicating copy to clipboard operation
vue-currency-input copied to clipboard

Drop MAX_SAFE_INTEGER limitation

Open dm4t2 opened this issue 2 years ago • 5 comments

Currently, the input is limited to Number.MAX_SAFE_INTEGER. Numbers should exposed as decimal strings ("1234.567") to allow arbitrary size and precision.

See also discussion #307

dm4t2 avatar Oct 02 '22 19:10 dm4t2

@dm4t2 Do you have any idea how much work is required to get this done? We are dealing with emission values that often have 10 or more decimal places, which means that we can enter just 6 digits before the decimal, which is not enough. Maybe we can contribute to get this done, if you are open to it?

janthurau avatar Oct 09 '23 07:10 janthurau

I worked on this some time ago as part of a proof of concept but only archived it. Most of the work is already done, but there are a lot of changes, including breaking ones. I'm looking forward to releasing a v4 beta soon, depending on my free time. It would be great if you could help out with testing.

dm4t2 avatar Oct 11 '23 21:10 dm4t2

Any update on Integer limitation? it only support 13 digits. Would it be BigInt? or Double type?

humaidaAra avatar Nov 23 '23 06:11 humaidaAra

The current plan is to expose numbers of arbitrary size/precision as decimal strings ("1234.567"). BigInt will be only used for internal calculations.

dm4t2 avatar Nov 26 '23 21:11 dm4t2

I'm using decimal.js in my project along with vue-currency-input. I think we can extract numeric functions and add provider layer instead. Bringing decimal.js as a provider may be a better solution than using two different sources: string & BigInt. So for the rest, we can just use string-based numerical presentation.

xgenvn avatar Dec 04 '23 05:12 xgenvn