It seems Money has a fixed precision and always have 4 decimals. This causes me problems cause lets say I have a table of items to sell, like below
create table #example (
id int,
name varchar(50),
price money
)
If the money column in #example is the price before VAT and VAT value is 8%, 4 decimals might not be enough. In below example I'm using an item price of 11usd (before vat)
insert into #example (id, name, price) values (1, 'asd', 11/1.08)
A select from #example now gives:
id name price
1 asd 10,1852
If I want to use this price to add the vat value I get the wrong value:
10.1852*1,08 = 11,000016
This leaves a wrong margin of 0,000016USD. Obviously I'm using it wrong. Anyone have any input on where I'm wrong on this?
Edit: I wouldn't say the attached question has my answer. I'm already certain to use money and I just need help on calculating the values back.