Sorting formatted numbers in a table #564
Unanswered
cypherpork
asked this question in
Q&A
Replies: 1 comment
-
Hello and welcome to SQLPage ! Unfortunately, there is no builtin solution to this, but you can use javascript to format the numbers after the page has and the table has been indexed. document.querySelectorAll('td.users').forEach(x => x.textContent = parseFloat(x.textContent).toLocaleString()); You can use the javascript property of the shell component to include this custom script. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The following sequel:
Produces a sortable table:
I want to format the numbers with thousands separators:
which produces the following for the US locale:
Now, the numbers are treated as text and slpage sorts them incorrectly.
Does anyone know an easy way to fix it?
Beta Was this translation helpful? Give feedback.
All reactions