On Nov 13, 2009, at 4:09 PM, mdipierro wrote: > > 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.
Float has 53 bits, no? > > On Nov 13, 5:10 pm, villas <villa...@gmail.com> wrote: >> On Nov 13, 9:59 pm, mdipierro <mdipie...@cs.depaul.edu> 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---