feat: first character of word to uppercase function

This commit is contained in:
Spudgun
2022-08-23 19:53:06 +12:00
parent c1851db261
commit 1dde823486
+5
View File
@@ -35,6 +35,11 @@ function QBShared.Trim(value)
return (string.gsub(value, '^%s*(.-)%s*$', '%1'))
end
function QBShared.FirstToUpper(value)
if not value then return nil end
return (value:gsub("^%l", string.upper))
end
function QBShared.Round(value, numDecimalPlaces)
if not numDecimalPlaces then return math.floor(value + 0.5) end
local power = 10 ^ numDecimalPlaces