|
[Rails I18n] Globalize Currencies: msg#00003lang.ruby.rails.i18n
I am quite there ... in creating the price , from the form pots, I should have written : @product = Product.new(@params[:product]) @product.price = Currency.parse(@product[:lp]) # -> gives me the correct price in DB when updating .. @product.price.format # ->will display the correct string in the text field BUT, if I update the value in the form , "150,00 €" will give 1500000 cents !!!!! (incredible way to make money I agree..) irb(#<AdminController:0x24c2ccc>):001:0> @p1.inspect => "\"150,00 €\"" irb(#<AdminController:0x24c2ccc>):002:0> p = Currency.parse(@p1) => #<Globalize::Currency:0x240c4f4 @cents=1500000> what's wrong with the parse in this case ? kad _______________________________________________ Railsi18n-discussion mailing list Railsi18n-discussion@xxxxxxxxxxxxx http://rubyforge.org/mailman/listinfo/railsi18n-discussion
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [Rails I18n] Globalizing Currency... last line, Kadoudal |
|---|---|
| Next by Date: | Re: [Rails I18n] [PATCH] to Globalize::Currency, Roland |
| Previous by Thread: | [Rails I18n] Globalizing Currency... last line, Kadoudal |
| Next by Thread: | Re: [Rails I18n] Globalize Currencies, Roland |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |