Разделение цифр точками

HatakeKakashi

Активный
Автор темы
230
41
Скрипт как на скрине пж, заранее спасибо(именно точками)
 

HatakeKakashi

Активный
Автор темы
230
41
А есть возможно пофиксить этот баг?
Screenshot_4.png

отсутствие второй точки в последнем стобце
 

BisQwit

Известный
456
125
На цр не проверял, не знаю как это пофиксить, прошу людей которые шарят исправить это
вот код
Код:
script_author("я")
require 'lib.moonloader'
local sampevcheck, sampev = pcall(require, "lib.samp.events")

function comma_value(n)
    local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
    return left..(num:reverse():gsub('(%d%d%d)','%1.'):reverse())..right
end

function separator(text)
    if text:find("$") then
        for S in string.gmatch(text, "%$%d+") do
            local replace = comma_value(S)
            text = string.gsub(text, S, replace)
        end
        for S in string.gmatch(text, "%d+%$") do
            S = string.sub(S, 0, #S-1)
            local replace = comma_value(S)
            text = string.gsub(text, S, replace)
        end
    end
    return text
end

function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
    text = separator(text)
    title = separator(title)
    return {dialogId, style, title, button1, button2, text}
end

function sampev.onServerMessage(color, text)
    text = separator(text)
    return {color, text}
end

function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
    text = separator(text)
    return {id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text}
end

function sampev.onTextDrawSetString(id, text)
    text = separator(text)
    return {id, text}
end