Answers.Body: <p>Assuming this is in Craft 3, you should be using <code>.orderBy()</code> instead of <code>.order()</code>. Does the following work as expected?</p>
  
  <pre><code>{% set users = craft.users.group('influencer').orderBy('score desc').limit(24) %}
  
  {% paginate users as pageInfo, pageUsers %}
  
  {% for user in pageUsers %}
      {{ user.username }} : {{ user.score }} &lt;br&gt;
  {% endfor %}
  </code></pre>
  
  <p>Here it is in the docs: <a href="https://docs.craftcms.com/v3/dev/element-queries/user-queries.html#orderby" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/element-queries/user-queries.html#orderby</a></p>
  
  <p>Also turn on <code>devMode</code> to be sure that no errors are being suppressed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-22T21:59:25.160Z
Answers.Text: I need to limit the array for Pagination to work, I've edited my answer with code but it's still not ordering them correctly.
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-23T06:51:09.610Z
Answers.Text: How exactly is it ordering them? I just did a local test and this appears to be working.
Answers.UserDisplayName: Ben Croker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-23T10:47:23.033Z
Answers.Text: Alphabetically for some reason? Could it be empty values?
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-23T14:06:50.840Z
Answers.Text: Well do any users actually have values store in their `score` field?
Answers.UserDisplayName: Ben Croker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-23T14:11:31.620Z
Answers.Text: Heh, yeah. 3 out of 5 entries have a user.score
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-23T20:09:52.520Z
Answers.Text: Then I don't see why it wouldn't work :)
Answers.UserDisplayName: Ben Croker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-24T08:43:41.983Z
Answers.Text: This is so bizarre!
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-24T12:09:21.730Z
Answers.Text: My advice would be to test it with entries with the template scaled down to the bare minimum, then troubleshoot from there.
Answers.UserDisplayName: Ben Croker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-24T12:10:18.607Z
Answers.Text: Could it be that the output is being cached? Does changing the limit make a difference?
Answers.UserDisplayName: Ben Croker
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-30T11:27:48.017Z
Answers.Text: nope, even changing the field that it's sorting on makes little difference. I think this is a bug?
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-30T11:35:02.097Z
Answers.Text: Think I figured this out - whole numbers work - decimal point numbers, fail.
Answers.UserDisplayName: JMKelley
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-22T20:17:32.733Z
Answers.LastActivityDate: 2019-05-23T06:50:25.627Z
Answers.LastEditDate: 2019-05-23T06:50:25.627Z
Answers.UserDisplayName: Ben Croker
Body: <p>I'm trying to order my entries by a numeric custom field named <code>score</code>, some of these values can be <code>0</code> but unfortunately, it's not getting ordered at all?</p>
  
  <pre><code>{% set users = craft.users.group('influencer').order('score').limit(24) %}
  
  {% if users|length %}
      {% paginate users as pageInfo, pageEntries %}
      {% for user in pageEntries %}
  </code></pre>
  
  <p>/* New Code */</p>
  
  <pre><code>  {% set users = craft.users.group('influencer').orderBy('score desc').limit(24) %}
  
            {% if users|length %}
  
            {% paginate users as pageInfo, pageEntries %}
            {% for user in pageEntries %}
  </code></pre>
  
Tags: <templating>
Title: Order by Numeric Custom Field Value
ThreadText: # Order by Numeric Custom Field Value
  
  (Asked by: username_0 on 2019-05-22)
  
  I'm trying to order my entries by a numeric custom field named `score`, some of these values can be `0` but unfortunately, it's not getting ordered at all?
  
  ```
  {% set users = craft.users.group('influencer').order('score').limit(24) %}
  
  {% if users|length %}
      {% paginate users as pageInfo, pageEntries %}
      {% for user in pageEntries %}
  
  ```
  
  /\* New Code \*/
  
  ```
    {% set users = craft.users.group('influencer').orderBy('score desc').limit(24) %}
  
            {% if users|length %}
  
            {% paginate users as pageInfo, pageEntries %}
            {% for user in pageEntries %}
  
  ```
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-22. Score: 3 | Accepted answer
  
  Assuming this is in Craft 3, you should be using `.orderBy()` instead of `.order()`. Does the following work as expected?
  
  ```
  {% set users = craft.users.group('influencer').orderBy('score desc').limit(24) %}
  
  {% paginate users as pageInfo, pageUsers %}
  
  {% for user in pageUsers %}
      {{ user.username }} : {{ user.score }} <br>
  {% endfor %}
  
  ```
  
  Here it is in the docs: <https://docs.craftcms.com/v3/dev/element-queries/user-queries.html#orderby>
  
  Also turn on `devMode` to be sure that no errors are being suppressed.
  
  > **Comments:**
  > **username_0**: I need to limit the array for Pagination to work, I've edited my answer with code but it's still not ordering them correctly.  
  > **username_1**: How exactly is it ordering them? I just did a local test and this appears to be working.  
  > **username_0**: Alphabetically for some reason? Could it be empty values?  
  > **username_1**: Well do any users actually have values store in their `score` field?  
  > **username_0**: Heh, yeah. 3 out of 5 entries have a user.score  
  > **username_1**: Then I don't see why it wouldn't work :)  
  > **username_0**: This is so bizarre!  
  > **username_1**: My advice would be to test it with entries with the template scaled down to the bare minimum, then troubleshoot from there.  
  > **username_1**: Could it be that the output is being cached? Does changing the limit make a difference?  
  > **username_0**: nope, even changing the field that it's sorting on makes little difference. I think this is a bug?  
  > **username_0**: Think I figured this out - whole numbers work - decimal point numbers, fail.  
  
  ---
  
  