# Number() Does not solve my equation.

## Recommended Posts

\$w = Number(1+2+10) ;returns 13

\$x = Number("3.14") ;returns 3.14

\$z = Number("tmp3") ;returns 0

umm, right... I'm making a basic calculator for a demonstration for my friend. But what the hell?! If you press + it sets "\$method[\$currentmethod]" to +. Now, it has to be a "+" or else I get a syntax error. Now when I put \$value[1] & \$method[1] & \$value[2] etc together it turns the mass into a string, then returns the first value. If I display the equation its all fine, but doesnt seem to work for as an equation... Is there any functionst to solve? Maybe I overlooked I checked the helpfile theres none like Equation() or Solve()...:/

##### Share on other sites

```\$test = Number(24/7)
MsgBox(0, 'test', "If you don't have it in a string you get this: (" & \$test & ")" & @CRLF & "Or you could simply make it an integer like this Int(24/7) if you don't want decimals (" & \$test2 & ")")```

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

Hmm, that doesnt quite help because it makes it a string as I add every 'method' (+, -, *, /) to the equation...

And it takes the first number/int if its a string

(Another word for 'number' is real idk why it does have a real() function ;P)

##### Share on other sites

Can you provide a real code... what your actually doing? What returns a 'literal string'?

Edit:

You'll need beta for this:

```\$test = Execute("24/7")
MsgBox(0, 'test', "(" & \$test & ")")```
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

Ah thanks, that works great! Exactly what I needed, sorry I didnt come back for awhile my comp had a loading OS problem (which fixed itself?)... but yea, it works! Thanks

## Create an account

Register a new account