Jump to content

annoying Number() function


 Share

Recommended Posts

I am trying to write a script which uses the number() function.

Basically, the program is supposed grab the clipboard, which will already have a mathematical expression (e.g "5 + 5") and then solve it and send() the answer.

This is what I have so far:

$a=clipget()

$b=number($a)

send($:)

However, because the expression in the clipboard is read as a string, the number function isn't solving the expression.

Instead, when I have an expression like "256 - 4", it would simply output "256" as it reads it as a string and cuts everything after the sign.

Any hints on how to solve this problem?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...