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

Reports : Show-ListView should sort currency and decimals #1195

Closed
michaellwest opened this issue May 30, 2020 · 2 comments
Closed

Reports : Show-ListView should sort currency and decimals #1195

michaellwest opened this issue May 30, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@michaellwest
Copy link
Member

The current behavior only sorts dates and integers. This should work for numbers with decimals including currency.

Question originally posted on Sitecore Stack Exchange.

@michaellwest michaellwest self-assigned this May 30, 2020
@michaellwest michaellwest added this to the 6.2 milestone May 30, 2020
@michaellwest
Copy link
Member Author

michaellwest commented May 30, 2020

Example: The following example demonstrates on earlier versions that the decimal and currency sorting doesn't work.

$decimalArray = 1.1, 2.2, 3.3, 10.0, 20.0, 30.0

$props = @{
    Title = "Decimal Sorting"
    InfoTitle = "Decimal Sorting"
    InfoDescription = "Decimal Sorting"
}

$decimalArray | Show-ListView @props -Property @{Label = "Decimals"; Expression={$_}},
    @{Label = "Currency"; Expression={"{0:c}" -f $_}},
    @{Label = "Number"; Expression={"{0:n0}" -f $_}}
Close-Window

@michaellwest
Copy link
Member Author

Now it works for integers, decimals (doubles), and currency.

2020-05-30_14-20-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

1 participant