localeconv#

Numeric and monetary formatting rules for the active locale.

תקציר#

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

מה מוחזר#

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).

מקרי קצה#

  • 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).

הבדלים מן ה-upstream#

Fully compatible with upstream POSIX.

ראו גם#

  • setlocale - pick which locale those rules come from.