Craig White wrote:
[...]
> ----
> well, the round(2) function will return 1.5 if that is the stored value
> in big decimal which was unacceptable 

Huh?  I don't understand what you're saying.

> but I didn't try
> @price.round(2).to_f but I wonder which is faster/slower.
> 
> In reality, though, it tossed an error...

Again, I don't understand.  Did you try it or not?

> 
> undefined method `round' for #<Price:0xb6e1bf20>
> 
> which I think is back to my original problem of having a big decimal,
> that must be converted to a float before it can be rounded.

No.  BigDecimal#round should work as I just explained -- at least it 
does on my system.  Are you sure @price is actually holding a 
BigDecimal?

> 
> Craig
> 

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to