title: Ruby on Rails Money gem: create money from form
body: <p>I'm quite new to Rails and this is the first time I'm using the money git. I inserted the following code into my model, as stated in the money gem wiki:</p>
  
  <pre><code>composed_of :cash,
  :class_name =&gt; "Money",
  :mapping =&gt; [%w(amount cents), %w(currency currency_as_string)],
  :constructor =&gt; Proc.new { |cents, currency| Money.new(cents || 0, currency ||     Money.default_currency) },
  :converter =&gt; Proc.new { |value| value.respond_to?(:to_money) ? value.to_money :     raise(ArgumentError, "Can't convert #{value.class} to Money") }
  </code></pre>
  
  <p>In my database I have two fields: amount (integer) and currency (string)</p>
  
  <p>I also have a form, were users can enter a certain cash-amount:</p>
  
  <pre><code>&lt;%= f.number_field :amount %&gt;
  </code></pre>
  
  <p>The problem here is that users fill in their amount like 1,50 instead of 150 cents. What is the best way to convert the user input of 1,50 to 150 before inserting this into the database?</p>
  
  <p>Regards,
  Gerwin</p>