Skip to content

Instantly share code, notes, and snippets.

@StrixG
Created August 9, 2022 15:03
Show Gist options
  • Save StrixG/09b680ab9663add60e6b128064c9834a to your computer and use it in GitHub Desktop.
Save StrixG/09b680ab9663add60e6b128064c9834a to your computer and use it in GitHub Desktop.
function getPluralString(count, pluralForms)
local lastDigit = count % 10
if count % 100 >= 11 and count % 100 <= 14 then
return pluralForms[1]
elseif lastDigit == 1 then
return pluralForms[2]
elseif lastDigit >= 2 and lastDigit <= 4 then
return pluralForms[3]
else
return pluralForms[1]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment