Skip to main content

setlocale

Function setlocale 

Source
pub fn setlocale(
    locale: option<string>,
    category: option<string>,
) -> option<string>
Expand description

Sets the current locale of the program.

§Parameters

  • locale: a system-dependent locale name. "" selects the native environment locale, "C" the standard C locale, and nil only queries the current locale.
  • category: which category to change: "all" (the default), "collate", "ctype", "monetary", "numeric" or "time".

§Return value

The name of the new locale, or nil if the request cannot be honoured.

§Examples

print(os.setlocale("C"))    --> C