You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you are able to repro it on the latest version
Search the existing issues.
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 returning 4 for 4.7, it returns 7.
Expected behavior
@'$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.jsonresources:- name: Echo integer value type: Test/Echo properties: output: fromString: "[int('4.7')]" fromNumber: "[int(4.7)]"'@| dsc config get
Name Value
---------
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
Latest build from main
Visuals
No response
The text was updated successfully, but these errors were encountered:
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.
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: