Case 1:
SELECT ROUND(CONVERT(FLOAT,'0.030') * CONVERT(FLOAT,'0.045'),4)
Result for above query is 0.013 which is wrong.
It should give 0.014 instead of 0.013
Case 2:
To overcome above scenario I have tried below query:
SELECT ROUND(CONVERT(DECIMAL(37,4),'0.030') * CONVERT(DECIMAL(37,4),'0.045'),4)
Then result is 0.014 which is right.
But it fails for below values:
SELECT ROUND(CONVERT(DECIMAL(37,4),'0.0011') * CONVERT(DECIMAL(37,4),'0.045'),4)
The Result is 0.0001 which is wrong.
It should give 0.0000
Can anyone suggest me why all these scenarios are taking place?
What should I have to use to overcome above scenarios?
Thank you