PercentToInt

Parameters
percentage real
max integer
comment
patch

1.00

Source
Blizzard.j
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