Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Mathematical operations on variables


  • Please log in to reply
5 replies to this topic
Gatta
  • Guests
  • Last active:
  • Joined: --
sum := (2+3)
MsgBox, %sum%

result := (%sum%-4)
MsgBox, %result%

Why second MsgBox doesn't give effect? How could I do it properly?

[Moved from Scripts & Functions. ~jaco0646]

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
result := ([color=red]sum[/color]-4)

MsgBox, %result%


Gatta
  • Guests
  • Last active:
  • Joined: --
Thank You very much!

  • Guests
  • Last active:
  • Joined: --
If I divide 2 numbers the result is for the fifth decimal place.

What should I do to get more or less exact result of dividing?

E.g. What should I do to get result only to the third place after the comma?

a4u
  • Guests
  • Last active:
  • Joined: --
See Round & SetFormat.

  • Guests
  • Last active:
  • Joined: --
Thanks.