On a second thought. The problem is not the rounding. If we use float internally we do not have the precision of 1c in $1billion.
On Nov 13, 5:10 pm, villas <[email protected]> wrote: > On Nov 13, 9:59 pm, mdipierro <[email protected]> wrote: > > > In trunk, again you can now do (sqlite only) > > while this works it is not clear to how it should work with forms and > > validators. Right now you insert decimal, retrieve, search, orderby, > > add but you cannot put them in forms. > > Great, I like the layout/flash too! > > Using the integers will give a 'perfectly' accurate result, but I can > see why this is a tricky exercise affecting all the forms/validators > etc. > > Maybe you're aiming too high for Sqlite? I mean, how about this: > > 1. Carry on using float for Sqlite. > 2. Round off the floats to the required places, i.e. Decimal(7,3) > rounds and saves 123.456789 as 123.46 > 3. When we retrieve the value from the database we get 123.460000001. > We simply trim it before using it. > 4. Will the amounts add up OK? Yes, except for extreme case uses -- > and you can be confident that those guys are already using Postgres > and Firebird etc. > > I know what you're thinking, it isn't perfect. But do the Sqlite > users care? No; and there's no point in getting the moon on a stick > if a lollypop will do! > > Again just 2cts; I don't want to think of you spending hours on > getting Sqlite 100% perfect when no one has ever asked for that. > > Best regards, D --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

