-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.The question is answered.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
This issue is a continuation of #19107 and #18492, which are closed as resolved. But this is not true.
The pscustomobject table representation of non-integer numbers rounds them up or down, regardless of the user's preference.
Values are rounded to two or three decimal places, depending on the System.Globalization.CultureInfo.CurrentCulture used.
For example user want to see five digits after decimal separator of property one and one digit of property two:
[pscustomobject] @{
one = [math]::Round(0.1234567,5)
two = [math]::Round(1.1234567,1)
}
one two
--- ---
0.12 1.10As you can see, the result was shocking. The user can format the output himself (as a string), but this effort looks strange.
Expected behavior
- The output values should match the user's preferences.
- The user does not have to make additional efforts to obtain the expected result.Actual behavior
The user is forced to change the type of the resulting values and reformat their output to obtain the desired result.Error details
It's not a bug. This is a change in the behavior of the classic table view.Environment data
Name Value
---- -----
PSVersion 7.3.2
PSEdition Core
GitCommitId 7.3.2
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.The question is answered.