-
Notifications
You must be signed in to change notification settings - Fork 29
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
The int()
function incorrectly handles non-integer numbers
#390
Comments
The root cause of this issue is within the tree-sitter-dscexpression grammar, so this will apply to other functions as well. For numbers, the grammar only expects an |
Should we raise an error when a user inputs a number with a fractional part for the function then, instead of returning the fractional part as an integer? I'm open to the fix being either raising a specific error or correcting the grammar to parse the number and return the integer without the fractional part. |
@michaeltlombardi can you confirm what ARM templates do in this case? |
The documentation indicates that it converts a string or integer to an integer (supported parameter types are I would personally, as a user and developer, prefer to be able to coerce floats to ints with a function called |
Prerequisites
Steps to reproduce
When using the
int()
function, I expect it to return the same value for a fractional number as the string representation of that fractional number. However, instead of returning4
for4.7
, it returns7
.Expected behavior
Actual behavior
Error details
No response
Environment data
Version
Latest build from
main
Visuals
No response
The text was updated successfully, but these errors were encountered: