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

Selection Table sorts number alphabetically #81

Open
GoulartNogueira opened this issue Sep 14, 2021 · 3 comments
Open

Selection Table sorts number alphabetically #81

GoulartNogueira opened this issue Sep 14, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@GoulartNogueira
Copy link

When I run the script, a pop-up appears so I can select an option.
There I can see the number of rating and downloads.

Problem:

When I click on a column header to sort that list, numbers sorted alphabetically:

10
2
300
4
500
51
6
75
...

Expected:

Numbers sorted numerically:

2
4
6
10
51
75
300
500
...

What I've tried:

            subtitlesItems += '"' + item['SubDownloadsCnt'] + '" '

Removing " from entry:

            subtitlesItems += ' ' + item['SubDownloadsCnt'] + ' '

Code works normally, but still sorted like numbers are string.

I believe it's something about zenity. But I'm not sure.

@emericg
Copy link
Owner

emericg commented Sep 21, 2021

Indeed this doesn't seem to work.
I tried a couple of things, including integer number, or real number with dots or comma to try and force zenity to handle them as numbers. I also try similar things directly in bash.
If there is a solution to this problem, it isn't documented either...

@emericg emericg added the help wanted Extra attention is needed label Sep 27, 2021
@JayKuswahey
Copy link

JayKuswahey commented Mar 10, 2023

Might it be an option to pad the numbers, so you can leave the type alone?

002
004
006
010
051
075
300
500

Can't code myself out of a paper bag though... :(

@emericg
Copy link
Owner

emericg commented Jan 2, 2024

Ok I wanted to try padding the numbers as a workaround, but it looks like the latest zenity version doesn't even bother sorting the texts anymore, so...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants