local INPUT = io.read("*numbers") or tonumber(io.read()) -- Makes sure the desired input is a number, otherwise it's nil.

local function CreateBar(ITEM, NUMBER) -- String, Number
    local self = {}

    self.Length = NUMBER

    if NUMBER > 40959 then
        print("ERROR: BYTE LIMIT (40960) EXCEEDED! PLEASE USE A NUMBER LOWER THAN THE BYTE LIMIT!")
    else
        return print(string.rep(ITEM, NUMBER))
    end
end

local function GetPercentage(Value, Accuracy, DecimalPlacement) -- Number (FLOAT), Bool, Number (INT)
    if Accuracy then
        return string.format("%." .. DecimalPlacement .. "f", Value * 100) -- Doesn't round, has deicaml points, accurate
    else
        return math.floor((Value * 100) + 0.5) -- Rounds to the nearest whole
    end
end

local function BarPercentage(BAR, PERCENTAGE) -- String, Number (FLOAT, DESIRED PERCENTAGE TO BE TAKEN OFF)
    return BAR - PERCENTAGE
end

CreateBar("-", INPUT)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: