I use Float for money at the moment.
I am moving from Mysql to Postgres and have not had any issues but i'm not sure
if Float actually works correctly.
Floats are being used for both broken number values and for money values.
should I change to numeric for Postgres as I do not see that Column
Using FLOAT for monetary amounts is an extremely bad idea because of the
inexactness of storage and arithmetic ..
Using MONEY is discouraged because it is too locale-sensitive
NUMERIC should be used instead
On 12/28/2011 11:48, Martijn Moeling wrote:
I use Float for money at the moment.
I am
Quick hack, figured I would share since there seemed to be other
people asking about it.
I couldn't get it to work with autoload=True for table reflection.
---
from sqlalchemy import types
from decimal import Decimal
class Money(types.UserDefinedType):
def get_col_spec(self):
don't use the MONEY type in PostgreSQL, use NUMERIC instead.
On 12/27/2011 20:39, dgardner wrote:
Quick hack, figured I would share since there seemed to be other
people asking about it.
I couldn't get it to work with autoload=True for table reflection.
---
from sqlalchemy import types
from