decimal.js
decimal.js copied to clipboard
question:Value of type 'typeof Decimal' is not callable. Did you mean to include 'new'?
please how resolve?
Try putting the following line above your code:
declare function Decimal(n: string | number | Decimal): Decimal;
Does that work? It's been a while since I've used typescript.
Or just change the code to:
settlementNumber = new Decimal(settlementNumber).add(v.settlementNumber).toNumber();
Same issue as #216. The decimal.d.ts file needs to be amended to support calling Decimal without using new.
The decimal.d.ts file needs to be amended to support calling Decimal without using new.
Actually why is it even allowed to call it as a function, without new? Now it's probably just backwards compatibility, but what was the use case at first?