PercentToInt

Parameters
percentagereal
maxinteger
comment
patch

1.00

Source
Blizzard.j (raise an issue to discuss on Github or submit a PR)
return type
integer
Source code
function PercentToInt takes real percentage, integer max returns integer
    local real realpercent = percentage * I2R(max) * 0.01
    local integer result = MathRound(realpercent)

    if (result < 0) then
        set result = 0
    elseif (result > max) then
        set result = max
    endif

    return result
endfunction