title: Rails Convert Percentage Value on Edit Form
body: <p>I have the following callback and method in my <code>Customer</code> model.</p>
  
  <pre><code>before_save :convert_commission_percentage
  
  def convert_commission_percentage
    self.commission= commission.to_f/100.to_f
  end
  </code></pre>
  
  <p>This allows the user to input a percentage as <code>45</code> and store it as <code>.45</code>.  However, on edit, the field for this percentage is then displayed as <code>.45</code> on the edit form, causing that number to be divided by 100 again on update.  Is there a way to keep this from happening by displaying the edit field as <code>45</code>?</p>