Advice on handling positive and negative decimals?

16 views
Skip to first unread message

pbreit

unread,
May 19, 2016, 6:32:38 PM5/19/16
to web2py-users
What's the prevailing best practice for storing financial debits and credits in the DB?

1 table of both or 2 tables (1 for each)?
1 column of positive and negative values or 2 columns (amount and type)?
store as integers (cents) or decimals (dollars)?

villas

unread,
May 19, 2016, 7:09:14 PM5/19/16
to web2py-users
I have given this quite a bit of thought in the past.  In the end,  I decided one column of decimals,  positive and negative does a good job.  It has always worked well for me and I have never had any reason to doubt it was the right thing to do. 

There are no doubt other opinions, and other circumstances,  YMMV :)

Reply all
Reply to author
Forward
0 new messages