'check that proper rounding is performed for float persistence'

def test_rounding_04(self):

    currency = self.env.ref('base.EUR')
    currency_rate = self.env['res.currency.rate']
    def try_roundtrip(value, expected):
        rate = currency_rate.create({'name': '2000-01-01', 'rate': value, 'currency_id': currency.id})
        self.assertEqual(rate.rate, expected, ('Roundtrip    error:    got    %s    back    from    db,    expected    %s' % (rate, expected)))
    try_roundtrip(2.6748955, 2.674896)
    try_roundtrip((-2.6748955), (-2.674896))
    try_roundtrip(10000.999999, 10000.999999)
    try_roundtrip((-10000.999999), (-10000.999999))
