localeconv#

Numeric and monetary formatting rules for the active locale.

Synopsis#

use POSIX qw(localeconv);
my $lc = localeconv();
print "Decimal: $lc->{decimal_point}\n";

What you get back#

A hashref whose keys are the struct lconv field names — decimal_point, thousands_sep, grouping, int_curr_symbol, currency_symbol, mon_decimal_point, mon_thousands_sep, mon_grouping, positive_sign, negative_sign, and the monetary char fields (int_frac_digits, frac_digits, p_cs_precedes, p_sep_by_space, n_cs_precedes, n_sep_by_space, p_sign_posn, n_sign_posn).

Edge cases#

  • Char fields equal to CHAR_MAX mean “not available in this locale”; all numeric char fields are returned unconditionally.

  • Returns undef if libc localeconv() fails (rare).

Differences from upstream#

Fully compatible with upstream POSIX.

See also#

  • setlocale — pick which locale those rules come from.