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

Allow Decimal's constructor to take a Number or String. #745

Closed
zslayton opened this issue Mar 2, 2023 · 1 comment
Closed

Allow Decimal's constructor to take a Number or String. #745

zslayton opened this issue Mar 2, 2023 · 1 comment
Assignees
Labels
enhancement v5.0.0 issues for v5.0.0 release
Milestone

Comments

@zslayton
Copy link
Contributor

zslayton commented Mar 2, 2023

See this discussion.

Constructing a dom.Decimal (which is typically what users want) from a number or string cannot be done in a single step unless you use ion.load(...), which is overkill.

Value.from(...) doesn't work. Because there is no hinting system (#620), Value.from will never return a dom.Decimal; a String maps to a dom.String, an integer Number maps to a dom.Integer, and a non-integer Number maps to a dom.Float.

@desaikd
Copy link
Contributor

desaikd commented Mar 6, 2023

Fixed with #746

@desaikd desaikd closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement v5.0.0 issues for v5.0.0 release
Projects
None yet
Development

No branches or pull requests

2 participants