Jump to content
  • 0

Calculation error


Yelay12
 Share

Question

local input=gg.prompt({"📩input first value။📩"},{"9223372036854775000"})
local input1=gg.prompt({"📩input second value။📩"})
mpy = tonumber(input[1]) * tonumber(input1[1])
gg.alert('📃result📃; "'..mpy..'" ', '📝copy📝')
gg.copyText(mpy)

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Make first operand floating-point by multiplying 1.0 by it, that way all calculations will be with floating-point values and you will get approximate result.

mpy = 1.0 * tonumber(input[1]) * tonumber(input1[1])
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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.