title: How to order by descending value in controller?
body: <p>I am trying to show the list of jobs ordered by <code>median_salary</code> by descending order. So far, it seems to only take into account the first number of <code>median_salary</code>. So something like 900 is listed above 1000, even though the value of 1000 > 900. </p>
  
  <p>homes_controller.rb: </p>
  
  <pre><code>def index
    nyc_highest = Highestpaidjob.where("city = ?", "NYC")
    @nyc_highest = nyc_highest.order("median_salary DESC")
  end
  </code></pre>
  
  <p>index.html.erb: </p>
  
  <p><code>&lt;%= @nyc_highest.inspect %&gt;</code> </p>
  
  <p>returns: </p>
  
  <p><code>#&lt;ActiveRecord::Relation [#&lt;Highestpaidjob id: 11, job: "Architect, City Planner", median_salary: "95928.48", count: 237, margin_of_error: "", city: "NYC", state: "New York", created_at: "2016-07-25 18:17:17", updated_at: "2016-07-25 18:17:17"&gt;, #&lt;Highestpaidjob id: 7, job: "Medical", median_salary: "170507.69", count: 128, margin_of_error: "", city: "NYC", state: "New York", created_at: "2016-07-25 18:09:30", updated_at: "2016-07-25 18:09:30"&gt;]&gt;</code></p>
  
  <p>It is listing 95928.48 as higher than 170507.69. Am I missing a condition? </p>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/9857888/best-way-to-implement-sort-asc-or-desc-in-rails">Best way to implement sort asc or desc in rails</a> and it seemed to suggest the way I am currently writing the sort.</p>