Hello, I’m trying to get a percentage of a value based of what percent another value is. Basically I have a Coins value and a Percent value and if percent is at 50 I want to get 50 percent of the coins value etc.
Example:
(Should say 1250)
Hello, I’m trying to get a percentage of a value based of what percent another value is. Basically I have a Coins value and a Percent value and if percent is at 50 I want to get 50 percent of the coins value etc.
Example:
(Should say 1250)
Recall that percentage notation is really just like this: n% = n/100
, e.g. 50% = 0.5
. Multiply your number by this number to get your result.
You may want to call math.floor
, math.ceil
, or math.round
to keep the results as integers.
couldn’t you just multiply the number of coins by the percent/100
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.