function updateFillLevelFramesExtended(self)
    local _, yOffset = self:getPosition()
    local isFirst = true

    for i = 1, #self.fillLevelBuffer do
        local fillLevelInformation = self.fillLevelBuffer[i]
        if fillLevelInformation.capacity > 0 or fillLevelInformation.fillLevel > 0 then
            local value = 0
            if fillLevelInformation.capacity > 0 then
                value = fillLevelInformation.fillLevel / fillLevelInformation.capacity
            end

            local frame = self.fillTypeFrames[fillLevelInformation.fillType]
            frame:setVisible(true)

            local fillBar = self.fillTypeLevelBars[fillLevelInformation.fillType]
            fillBar:setValue(value)

            local baseX = self:getPosition()
            if isFirst then
                baseX = baseX + self.firstFillTypeOffset
            end
            frame:setPosition(baseX, yOffset)

            local precision = fillLevelInformation.precision or 0

            local formattedNumber
            if precision > 0 then
                local rounded = MathUtil.round(fillLevelInformation.fillLevel, precision)
                formattedNumber =
                    string.format(
                    "%d%s%0" .. precision .. "d",
                    math.floor(rounded),
                    g_i18n.decimalSeparator,
                    (rounded - math.floor(rounded)) * 10 ^ precision
                )
            else
                formattedNumber = string.format("%d", MathUtil.round(fillLevelInformation.fillLevel))
            end

            self.weightFrames[fillLevelInformation.fillType]:setVisible(fillLevelInformation.maxReached)

            local fillTypeName, unitShort
            if fillLevelInformation.fillType ~= FillType.UNKNOWN then
                local fillTypeDesc = g_fillTypeManager:getFillTypeByIndex(fillLevelInformation.fillType)
                fillTypeName = fillTypeDesc.title
                unitShort = fillTypeDesc.unitShort
            end

            local fillText = string.format("%s%s (%d%%)", formattedNumber, unitShort or "", math.floor(100 * value))  
            if fillTypeName ~= nil then fillText = fillTypeName.." "..fillText end;

            self.fillLevelTextBuffer[#self.fillLevelTextBuffer + 1] = fillText;

            if fillTypeName ~= nil then
                self.fillTypeTextBuffer[#self.fillLevelTextBuffer] = fillTypeName
            end

            yOffset = yOffset + self.frameHeight + self.frameOffsetY
            isFirst = false
        end
    end
end

FillLevelsDisplay.updateFillLevelFrames = Utils.overwrittenFunction(FillLevelsDisplay.updateFillLevelFrames, updateFillLevelFramesExtended)
