garrysmod-requests
garrysmod-requests copied to clipboard
International number formatting API
trafficstars
Details
It'd be great to have a function like language.FormatNumber that returns the correctly formatted number for the user's currently selected language.
Example of different locale number styles:
mynumber = 123_456_789.012
// 123456789.012345
new Intl.NumberFormat("en-GB").format(mynumber)
// "123,456,789.012"
new Intl.NumberFormat("de-DE").format(mynumber)
// "123.456.789,012"
new Intl.NumberFormat("fr-FR").format(mynumber)
// "123 456 789,012"
new Intl.NumberFormat("en-IN").format(mynumber)
// "12,34,56,789.012"
Should be in LUA, so better make a Pool Request to the garrysmod repository
Should be in LUA, so better make a Pool Request to the garrysmod repository
This is a standard feature of i18n libraries so I'd rather not go to the effort of making a very slow string manipulation mess myself if it could be a single FFI call instead.
Also Lua isn't an acronym, it's a proper noun.