I have a table for a percentage in Tax.
Data Type = Number
Field Size = Single
Another table with Data Type set to Currency. Field = Amount.
So I have a report to calculate the Tax.
txtTax = 0.05
txtAmount = 16998650
Text1 = txtAmount * txtTax
Result of Text1: $16,998,650.51
We have a rounding error of 0.01
So, if I were to use the Field Size of Double or Decimal. There's no problem in rounding. However, there are problems with floating point errors that might happen or occur with these Data Types.
So the question is, what Data Type do we use for Tax?
I'm thinking of
Choice 1
Data Type = Number
Field Size = Decimal
Choice 2
Data Type = Currency
Format = Currency
Decimal place = Auto
The percentage of Tax is a decimal number, but with Single the rounding error will occur in some cases. If Decimal, it works but doesn't look good with floating points.
So the best choice seems like "Choice 2"?
Data Type = Number
Field Size = Single
Another table with Data Type set to Currency. Field = Amount.
So I have a report to calculate the Tax.
txtTax = 0.05
txtAmount = 16998650
Text1 = txtAmount * txtTax
Result of Text1: $16,998,650.51
We have a rounding error of 0.01
So, if I were to use the Field Size of Double or Decimal. There's no problem in rounding. However, there are problems with floating point errors that might happen or occur with these Data Types.
So the question is, what Data Type do we use for Tax?
I'm thinking of
Choice 1
Data Type = Number
Field Size = Decimal
Choice 2
Data Type = Currency
Format = Currency
Decimal place = Auto
The percentage of Tax is a decimal number, but with Single the rounding error will occur in some cases. If Decimal, it works but doesn't look good with floating points.
So the best choice seems like "Choice 2"?