Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
Torkas
- Newbie
- Posts: 10
- Joined: Wed Sep 30, 2015 5:41 pm
Post
by Torkas » Tue Oct 01, 2019 8:10 pm
Hi, I am trying use a simple script for apply a subtract with decimals but with MS the result is this:
Let>a=8.98
Let>b=8.1
Let>c=%a%-%b%
MessageModal>%c%
[0.880000000000001]
In this case the result is exact and I don't understand why the result is this ?¿? With a normal calculator or "Windows calculator" the result is: [0.88]. I don't want to use the FORMAT command if is possible.
Any idea about this ? Thank you so much in advance !!!

Last edited by
Torkas on Thu Oct 03, 2019 2:06 pm, edited 1 time in total.
-
Dorian (MJT support)
- Automation Wizard
- Posts: 1416
- Joined: Sun Nov 03, 2002 3:19 am
Post
by Dorian (MJT support) » Wed Oct 02, 2019 1:35 pm
That isn't what I'd have expected either. I'll ask Marcus about this, but in the meantime I
would use the format command.
Code: Select all
Let>a=8.98
Let>b=8.1
Let>c=%a%-%b%
Format>%.2n,c,c
MessageModal>%c%
-
Torkas
- Newbie
- Posts: 10
- Joined: Wed Sep 30, 2015 5:41 pm
Post
by Torkas » Thu Oct 03, 2019 1:48 pm
This problem only occurs when you use some combinations of subtracts with decimals. Maybe It could be a litte bug of MS ... In any case, using after the FORMAT command the result is OK.
Thank you so much equally for the response !

-
Dorian (MJT support)
- Automation Wizard
- Posts: 1416
- Joined: Sun Nov 03, 2002 3:19 am
Post
by Dorian (MJT support) » Fri Oct 04, 2019 8:59 am
I asked Marcus about this and his response it's because the numbers are floating point numbers internally.