See image attached if is possible!!!!!!
Note:
all var are dimensioned double
difference with the same value get error
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
difference with the same value get error
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78535
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: difference with the same value get error
It could be due to a rounding error. Try adding a line
Debug.Print IMPORTO_OPERAZ - SECONDO_TOT
Debug.Print IMPORTO_OPERAZ - SECONDO_TOT
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: difference with the same value get error
wow!!!!!!!!!!!!!HansV wrote:It could be due to a rounding error. Try adding a line
Debug.Print IMPORTO_OPERAZ - SECONDO_TOT
this is the result of Debug.Print IMPORTO_OPERAZ - SECONDO_TOT
4,54747350886464E-13
How to adjust?
-
- Administrator
- Posts: 78535
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: difference with the same value get error
If the numbers are amounts of money, you could round the numbers to 2 decimal places:
SECONDO_TOT = Round(PRIMO_TOT - RESTO, 2)
Or you could declare the variables as Currency instead of as Double.
SECONDO_TOT = Round(PRIMO_TOT - RESTO, 2)
Or you could declare the variables as Currency instead of as Double.
Best wishes,
Hans
Hans