Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help understanding this short money script ,because I what to make bigger money?

Asked by 5 years ago

I need help to understand this i what to make it go bigger but i don't get (..(x:sub(#x-7,(#x-7))).. ) part

function module:ConvertShort(Filter_Num)
    local x = tostring(Filter_Num)
    if #x>=10 then
        local important = (#x-9)
        return x:sub(0,(important)).."."..(x:sub(#x-7,(#x-7))).."B+"
    elseif #x>= 7 then
        local important = (#x-6)
        return x:sub(0,(important)).."."..(x:sub(#x-5,(#x-5))).."M+"
    elseif #x>=4 then
        return x:sub(0,(#x-3)).."."..(x:sub(#x-2,(#x-2))).."K+"
    else
        return Filter_Num

    end
    end
0
what do you mean by "bigger" tonyv537 95 — 5y
0
i what to make a trill tylergoatboy 82 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Is this what you're trying to do? You didn't explain very well.

function module:ConvertShort(Filter_Num)
    local x = tostring(Filter_Num)
    if #x>=13 then
        local important = (#x-12)
        return x:sub(0,(important)).."."..(x:sub(#x-11,(#x-11))).."T+"
    elseif #x>=10 then
        local important = (#x-9)
        return x:sub(0,(important)).."."..(x:sub(#x-7,(#x-7))).."B+"
    elseif #x>= 7 then
        local important = (#x-6)
        return x:sub(0,(important)).."."..(x:sub(#x-5,(#x-5))).."M+"
    elseif #x>=4 then
        return x:sub(0,(#x-3)).."."..(x:sub(#x-2,(#x-2))).."K+"
    else
        return Filter_Num

    end
end
0
thx tylergoatboy 82 — 5y
Ad

Answer this question