Calculator using strings

WAIT WHAT! I need to try this! ASAP

it works! I am just… surprised! Time to make a plugin or something out of it and yea still thank you so much for the help this really helps!

1 Like

hey so how do i do race to power? for somereason it does addition and % also doesnt work for me

You can look into the module and see how some of the functions are made. I know they made something that does percent and power, it’s just in a more complicated way. You could give Birdelther a PM and ask about the module and it’s functions to remove the hassle. If you don’t want to though, I can check inside of the module myself and see if theres a power or a percentage. You can probably do something like pow for getting powers.

Like, within your script you can have a button named pow but the text saying ^. Then making another elseif button.Name == "pow" then, something like this:

elseif button.Name == "pow" then

TextBox.Text ..= "pow("
end

--[[ you can try to find a way for putting the end parenthesis inside of the function. 
like if the button has been pressed once and it just says ^, it will put pow( in there. 
when it gets clicked again and it's named "end power" or a bool to express that it's active, 
then it'll change the function from adding "pow(" to ")" to finish the expression.]]

I was thinking of this example when looking through the post again, I'm making a gui calculator, how to convert string to operators? - #16 by blokav

He did “asin(1)*2” as a string, so that would mean if we just did something like "pow(10, 4)"it in like that it’d work as intended.

1 Like

yea but I insist Ill go check through that

2 Likes

Since it’s a standalone parser you can’t really use the math library functions in the inputs, so you would need to use the built-in operators as @edozune explained.

The parser requires you to use ‘pow(x, y)’ instead of ‘x ^ y’ because the ‘^’ symbol is used for the bitwise ‘xor’ operation.

In this thread someone had a similar problem with wanting to use ^ for exponents. I think I gave them a solution for it.

If you need it the original source and documentation can be found here: