[Contact Form DB] Problem sorting larger numbers
-
Background: I am using the transform shortcode below to sort the table by the AUDIENCE field… which is the number of people who participated in an event. I am using Contact Form DB Version 2.10.29…not able upgrade to the latest version just yet.
NaturalSortByField(AUDIENCE,DESC) &&AddRowNumberField(#,1)
Problem: Numbers with 7 digits or greater are not being sorted out of order. I noticed it is the second comma in a number (separating millions from thousands) which causes those numbers to be sorted out of order. If I remove that second comma, the number is sorted correctly, similar to the other numbers.
Example:
6,453,324 – sorts out of order
6453324 or 6453,324 – sorts the number correctlyFull Shortcode
[cfdb-table form=”Peanut Allergy” show=”#,RANKING,MARKET,OUTLET,NETWORK,FORMAT,PREVIEW-ONLINE-URL,DATE,TIME-local,LENGTH,AUDIENCE” role=”Anyone” permissionmsg=”false” trans=”NaturalSortByField(AUDIENCE,DESC) &&AddRowNumberField(#,1)” headers=”#=#,RANKING=RANKING,MARKET=MARKET NAME,OUTLET=OUTLET,NETWORK=NETWORK,FORMAT=FORMAT,PREVIEW-ONLINE-URL=TV RADIO PREVIEW-ONLINE URL,DATE=DATE,TIME-local=TIME (local),LENGTH=LENGTH,AUDIENCE=AUDIENCE” id=”mytable” style=”#mytable body,td,th,tr,div { font-size: 12px; }”]
Any help with this issue would be greatly appreciated. Thanks so much!
- The topic ‘[Contact Form DB] Problem sorting larger numbers’ is closed to new replies.