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

Impossible to force literalNum(10.0) to be a double #345

Open
m0nac0 opened this issue Nov 5, 2021 · 0 comments
Open

Impossible to force literalNum(10.0) to be a double #345

m0nac0 opened this issue Nov 5, 2021 · 0 comments

Comments

@m0nac0
Copy link

m0nac0 commented Nov 5, 2021

If I use literalNum(10.0), the result will be 10. But I need to make sure the result is a double, i.e. has at least one decimal digit.
Is there any way to achieve that?
If not, maybe something like this: Expression literalDouble(double value) => LiteralExpression._(value.toString()); could be added to literal.dart? If I understand the docs for double.toString() correctly, that should ensure that at least one decimal digit is included in the output.
Thank you!

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

1 participant