Displaying 2 results from an estimated 2 matches for "amount_due".
2006 Apr 12
2
Problems doing addition/subtraction with floats
Ok, I am sure this is a simplistic problem that I am just missing right now
(maybe eyes are crossed??).
However, I am trying to do simply math here.
I have these variables initialized as follows:
@amount_due = @amount_paid = @total_due = 0.0
I get @total_due and it is set to 1739.6 from the database.
I then get @amount_paid and it is set to 1739.6 from the database.
I then calculate the @amount_due = @total_due - @amount_paid.
This value is 2.27373675443232e-013.
????
Sorry if this is on the list s...
2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
...t that creates this stuff pretty quickly I can share)
module RenewalSpecHelper
def min_renewal_attribs
{
:member_id => 1,
:order_id => 1,
:date_renewed => Date.new(2007, 1, 1),
:membership_type_id => 1,
:shirt_size => ''M'',
:amount_due => ''5000''
}
end
def min_renewal
Renewal.new :attributes => min_renewal_attribs
end
def mock_renewal(stubs = {})
obj = mock_model(Renewal, {
:member_id => 1,
:date_renewed => Date.new(2007, 1, 1),
:membership_type_id => 1,...