title: How do I convert a decimal to string value for dollars and cents in ruby?
body: <p>I am storing a cost in my application.  The cost is not formatted in the database. For example: 00.00 saves as 0, 1.00 saves as 1, and 40.50 saves as 40.5</p>
  
  <p>I need to read these values from the database and convert them to strings for dollars and cents.  For example: 0  --> cost_dollars = "00" &amp; cost_cents = "00", 1 --> cost_dollars = "01" &amp; cost_cents = "00", 40.5 --> cost_dollars = "40" &amp; cost_cents = "50".</p>
  
  <p>Is there an easy way to do this in ruby on rails?  Or does someone have code that does this?</p>
  
  <p>Thanks!</p>