How to get a percent of a number

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:
image

(Should say 1250)
image

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.

1 Like

couldn’t you just multiply the number of coins by the percent/100

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.