Always the same problem

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Always the same problem

Post by sal21 »

I have this two value:


-16.285,15 -16.284,75


i get with:
....
dim DARE as double
Trim(Mid(CurrentLine, 85, 17) - Format(DARE, "#,##0.00"))
...


insted the difference is 0,34 i have

-0,399999999999636

User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Always the same problem

Post by HansV »

You can use Round(..., 2) to round the result to 2 decimal places.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: Always the same problem

Post by sal21 »

HansV wrote:You can use Round(..., 2) to round the result to 2 decimal places.
ahhhhhhh....

you just post a solution in other my question, sorry for tath. :grin: :thankyou:

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: Always the same problem

Post by sal21 »

HansV wrote:You can use Round(..., 2) to round the result to 2 decimal places.

hohohoh...

i have dimensioned Double IMPORTO....

now i have IMPORTO=-20503601554,92

when i process this var have "error overfloow"

How to dim correct IMPORTO?

User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Always the same problem

Post by HansV »

I can't reproduce the error.
Best wishes,
Hans