Help with Numerical Prefix bug

this thread may be a bit vague and confusing, but i want to post it for seeking help for problem.

two days ago, i once showed up my creation numerical prefix here and i later noticed the bug,
it was when the value reached 16, it returned “DECA” (10) string instead of “SEXDECA” (16)
image
but when i tested my code in game maker 8.1, where i made a numerical prefix script and ported it to roblox studio, it returned correct prefix
image
by comparing to and original gml and lua port scripts

switch pc_ones
{
...
case 6:
    switch pc_tens
    {
        case 0:
        case 1:
        case 8:
            strTemp2 += "SEX"
            break
        case 2:
        case 3:
        case 4:
        case 5:
            strTemp2 += "SES"
            break
        case 6:
        case 7:
        case 9:
            strTemp2 += "SE"
            break
    }

    break
...
}
:case(6, function()
    local pcTensCaseS = switch()
        :case(0, function()
	end)
	:case(1, function()
	end)
	:case(8, function()
	    strTemp = strTemp.."SEX"
	end)
	:case(2, function()
	end)
	:case(3, function()
	end)
	:case(4, function()
	end)
	:case(5, function()
	    strTemp = strTemp.."SES"
	end)
	:case(6, function()
	end)
	:case(7, function()
	end)
	:case(9, function()
	    strTemp = strTemp.."SE"
	end)
	pcTensCaseS(pcTens)
end)

they are almost, or pretty the same, but except gml script, it has switch case statement while lua port doesnt (i used metatablecatgirl’s custom switch case statement module for it). also, gml’s has a “loop” to check conditions from top to bottom, and that is why it returned correct prefix, regardless of how “pc_tens” met the requirement or not

although i was aware of that, im still unable to fix it. so any help or contribution would appreciate me much

here’s the file:
Prefix Cardinal demo.rbxl (31.1 KB)
and a gml script:

1 Like