Hi all,
I was under the impression that using currencies for calculations was the way to use (max.) six decimal places, but that does not seem to be necessarily so. I get a result with only four decimal places instead of the expected 6 decimals.
Now I have used numerics as intermediate fields and found it to be correct calculation. What causes the difference in the calculation of currencies?
lcyKgPrijs = TblSlachtrapport.DEF_PrijsNoteringWeekprijs // 0.595
lcyBtwPerc = TblBtw.BTWPercentage // 6
lcyKgPrijsExcl = round(lcyKgPrijs / (100.0 + lcyBtwPerc) * 100.0, 6)
// lcyKgPrijsExcl is : 0.5613 --> 4 decimals, but should be 6 decimals
lnKgPrijs is numeric(5,7) = TblSlachtrapport.DEF_PrijsNoteringWeekprijs // 0.595
lnBtwPerc is numeric(5,7) = TblBtw.BTWPercentage // 6
lcyKgPrijsExcl = Round(lnKgPrijs / (100.0 + lnBtwPerc) * 100.0, 6)
// lcyKgPrijsExcl is : 0.561321 is OK
Thanks for any hints.
I was under the impression that using currencies for calculations was the way to use (max.) six decimal places, but that does not seem to be necessarily so. I get a result with only four decimal places instead of the expected 6 decimals.
Now I have used numerics as intermediate fields and found it to be correct calculation. What causes the difference in the calculation of currencies?
lcyKgPrijs = TblSlachtrapport.DEF_PrijsNoteringWeekprijs // 0.595
lcyBtwPerc = TblBtw.BTWPercentage // 6
lcyKgPrijsExcl = round(lcyKgPrijs / (100.0 + lcyBtwPerc) * 100.0, 6)
// lcyKgPrijsExcl is : 0.5613 --> 4 decimals, but should be 6 decimals
lnKgPrijs is numeric(5,7) = TblSlachtrapport.DEF_PrijsNoteringWeekprijs // 0.595
lnBtwPerc is numeric(5,7) = TblBtw.BTWPercentage // 6
lcyKgPrijsExcl = Round(lnKgPrijs / (100.0 + lnBtwPerc) * 100.0, 6)
// lcyKgPrijsExcl is : 0.561321 is OK
Thanks for any hints.