just a note here, this solution will work well, but it depends on the table you are working with
examples:
this works
{
["abc"] = 5000,
["def"] = 15000,
["ghi"] = 35000,
["jkl"] = 50000,
["mno"] = 75000
}
{
["1"] = 5000,
["2"] = 15000,
["3"] = 35000,
["4"] = 50000,
["5"] = 75000
}
this doesn't work
{
["How"] = 5000,
["Are"] = 15000,
["You"] = 35000,
["Today"] = 50000,
["?"] = 75000
}
{
["1"] = 5000,
["2"] = 15000,
[3] = 35000,
["4"] = 50000,
["5"] = 75000
}
{
[true] = 5000,
[false] = 15000
}
you might be wondering, why doesnât this work with all dictionaries?
well the function sorts alphanumerically, this means that it will work if the number keys are in order or if the text is in alphabetical order
you also canât have a string and a number as a key in the same table, this is because you canât compare string and number
anyways since it sorts alphanumerically stuff like this also wonât work right
more stuff that doesn't work
{
["5"] = 5000,
["4"] = 15000,
["3"] = 35000,
["2"] = 50000,
["1"] = 75000
}
{
["mno"] = 5000,
["jkl"] = 15000,
["ghi"] = 35000,
["def"] = 50000,
["abc"] = 75000
}
{
["One"] = 5000,
["1"] = 15000,
["Two"] = 35000,
["2"] = 50000
}
hope some find this reply a bit helpful