Subject | decimal(18,4) |
---|---|
Author | Bogusław Brandys |
Post date | 2005-08-16T08:19:06Z |
I always store money values in field decimal(18,4),because I found it
good for tax computation.
Is this correct way for any currency limited to 1/100 like
1$=100c,1PLN=100gr etc. ?
Look at example below:
x=2.22 - 7%TAX=2.0747[663..]
cast(x as decimal(18,2))= 2.07 not 2.08
because for example 2.0747[663..]$ =~ 207.48c and it is rounded to 207c
Is my assumption correct ?
Regards
Boguslaw Brandys
good for tax computation.
Is this correct way for any currency limited to 1/100 like
1$=100c,1PLN=100gr etc. ?
Look at example below:
x=2.22 - 7%TAX=2.0747[663..]
cast(x as decimal(18,2))= 2.07 not 2.08
because for example 2.0747[663..]$ =~ 207.48c and it is rounded to 207c
Is my assumption correct ?
Regards
Boguslaw Brandys