T
Tom Mac
Hi
I have a variable say @price. It is either blank or has a value. If
it is blank I have to show it like $ 0.00 . So I wrote helper like
@price.blank? ? '$'+'0.00' : '$'(e-mail address removed)_s
But the problem if @price has value 400.00 , after doing
@price.to_s it changes to 400.0 What I want is exactly 400.00 .And if
I remove to_s above it will throw an error
can't convert BigDecimal into String
Please help
Thanks
Tom
I have a variable say @price. It is either blank or has a value. If
it is blank I have to show it like $ 0.00 . So I wrote helper like
@price.blank? ? '$'+'0.00' : '$'(e-mail address removed)_s
But the problem if @price has value 400.00 , after doing
@price.to_s it changes to 400.0 What I want is exactly 400.00 .And if
I remove to_s above it will throw an error
can't convert BigDecimal into String
Please help
Thanks
Tom