Hi Kad,

this is exactly what i patched, read the other thread :)

Greetings,
Roland

Kad Kerforn wrote:
> 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


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Railsi18n-discussion mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/railsi18n-discussion

Reply via email to