I use in the model the type float and MySQL as backend database and MySQL uses INT() as datatype for that field....
So i must use decimal(10,2) as field type in the model and as backand db postgres? Op donderdag 14 augustus 2014 21:39:56 UTC+2 schreef Cliff Kachinske: > > What database? > > Web2py has a decimal datatype which, in my use cases, mimics the Python > decimal datatype. I use Postgresql and the adapter turns Python decimal > into Postgres numeric. Both of these types act like real world decimal > numbers. In other words, .2 + .1 comes out to .3. Of course a different db > backend may work differently. > > Just google python decimal. > > On Friday, July 11, 2014 5:50:30 AM UTC-4, Stefan van den Eertwegh wrote: >> >> Hi, >> >> I have a float type in the define tables and when he inserts 3.50 into >> the database he makes 4.0 off it. >> How comes that it rounds off the float? And not uses the usage of 2 >> decimals? >> >> Thank you! >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

