Home › Forums › General Issues › Number Field – Outputting and Sorting Negative Numbers › Reply To: Number Field – Outputting and Sorting Negative Numbers
That has nothing to do with WP or ACF.
The values are sorted descending as text strings, not numbers.
“-” is less than “0” when evaluated as a string, that is why the negatives appear at the end. But “-0.77” is greater than “-0.57” when shorted as a string because “7” (ASCII = 55) > “5” (ASCII = 53). It may not be using ACSII, but 7 is always > 5 when evaluated as a string.
You should probably ask the developer of list.js
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.