Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question:Value of type 'typeof Decimal' is not callable. Did you mean to include 'new'? #232

Open
web-shenjin opened this issue Feb 1, 2024 · 2 comments

Comments

@web-shenjin
Copy link

image

please how resolve?

@MikeMcl
Copy link
Owner

MikeMcl commented Feb 1, 2024

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.

@jakub791
Copy link

jakub791 commented Jun 2, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants