NAME
Module::Generic::Number::Format - Locale-aware number formatting for Module::Generic::Number
SYNOPSIS
use Module::Generic::Number::Format;
# Direct instantiation
my $fmt = Module::Generic::Number::Format->new( 1234567.89 ) ||
die( Module::Generic::Number::Format->error );
# or
my $n = Module::Generic::Number::Format->new( 10,
{
thousand => ',',
decimal => '.',
precision => 2,
# Currency symbol
symbol => '€',
# Display currency symbol before or after the number
precede => 1,
});
# Even accepts numbers in Japanese double bytes
# Will be converted automatically to regular digits.
my $n = Moule::Generic::Number::Format->new( "−1234567" ); # becomes -1234567
# or, to get all the defaults based on language code
my $n = Module::Generic::Number::Format->new( 1234567.89,
{
lang => 'fr_FR',
# or
# locale => 'fr_FR',
});
# this would set the decimal separator to ',', the thousand separator to ' ', and precede to 0 (false).
print( "Number is: $n\n" );
# prints: 1 234 567,89
my $n_neg = Module::Generic::Number::Format->new(-10);
$n_neg->abs # 10
$n->clone # Cloning the number object
$n->currency # €
$n->decimal # .
$n->format # 1,000.00
$n->format(0) # 1,000
$n->format(
precision => 0,
# Boolean value
decimal_fill => 0,
thousand => ',',
decimal => '.',
);
$n->format_binary # 1111101000
my $n2 = $n->clone;
$n2->format_bytes # 1K
$n2->format_hex # 0x400
$n2->format_money # € 1,024.00
$n2->format_money( '$' ) # $1,024.00
# General formatting
say $fmt->format(2); # "1,234,567.89"
say $fmt->format_money; # "€1,234,567.89" (locale-dependent)
say $fmt->format_bytes; # "1.18 GiB" (auto-scaled)
say $fmt->format_binary; # "100101101110000011010001011"
say $fmt->format_hex; # "0x12D687"
# format_money() follows the monetary category (LC_MONETARY), independently from
# format() which follows the numeric category (LC_NUMERIC). Under posix_strict
# (true by default), the two can therefore be grouped differently:
my $m = Module::Generic::Number::Format->new( 1281284,
{
precision => 2,
grouping => 0, # numeric: no grouping
mon_grouping => 3, # monetary: grouped by 3
mon_thousand => ',',
mon_decimal => '.',
symbol => '€',
precede => 0,
space_pos => 0,
});
$m->format # 1281284.00
$m->format_money # 1,281,284.00€
# Set posix_strict to false to fill a value absent from one category from the
# sibling category (the previous, more tolerant resolution).
my $loose = Module::Generic::Number::Format->new( 1000, { posix_strict => 0 } );
$n2->format_negative # -1,024.00
$n2->format_picture( '(x)' ) # (1,024.00)
$n->from_binary( "1111101000" ) # 1000
$n->from_hex( "0x400" ) # 1000
# Change position of the currency sign
$n->precede(1) # Set it to precede the number
# Change precision
$n->precision(0)
$n->symbol # €
$n->thousand # ,
$n->unformat( "€ 1,024.00" ) # 1024
# Rounding
say $fmt->round(1); # formatter with 1234567.9
say $fmt->round2(2); # formatter with 1234567.89 (high-precision)
say $fmt->round_zero; # formatter with 1234568 (ties away from zero)
# Reverse: strip formatting back to a raw number
my $raw = $fmt->unformat( '€ 1.234.567,89' );
# Changing locale at any time
$fmt->set_locale( 'ja_JP' );
# Accessed indirectly via Module::Generic::Number (lazy-loaded)
use Module::Generic::Number;
my $n = Module::Generic::Number->new(42);
say $n->format(0); # "42", triggers lazy load of this module
VERSION
v0.1.1
DESCRIPTION
Module::Generic::Number::Format is the formatting companion to Module::Generic::Number. It is never loaded unless a formatting operation is actually requested, so that plain numeric objects such as line-number or offset counters remain lightweight. See "format" in Module::Generic::Number for details of the lazy-loading mechanism.
This class inherits from Module::Generic and holds all state related to locale, monetary symbols, decimal separators, digit grouping, suffix strings for byte formatting, and the corresponding formatting algorithms.
Design
The class is instantiated internally by Module::Generic::Number via its _get_formatter and _instantiate_format private methods. It can also be used directly when formatting is the primary concern and the overhead of the full numeric object is not needed.
On construction, init() queries POSIX::setlocale(LC_ALL) and POSIX::localeconv() to populate all formatting properties from the active system locale. An explicit locale (or lang) option overrides this. All sixteen formatting properties can subsequently be overridden individually via their accessor methods, or reset in one call via "set_locale".
Thread Safety
When Perl is built with thread support ($Config{useithreads}), calls that temporarily alter LC_ALL to probe a requested locale are guarded by a shared lock ($LOCALE_LOCK). The lock is always released before the method returns, so the system locale is never left in a modified state.
CONSTRUCTOR
new
my $fmt = Module::Generic::Number::Format->new( $number ) ||
die( Module::Generic::Number::Format->error );
my $fmt = Module::Generic::Number::Format->new( $number, %options ) ||
die( Module::Generic::Number::Format->error );
Creates a new formatter for $number. $number must be a defined, non-empty scalar that represents a finite numeric value. Infinity and NaN values are rejected.
Any key-value pairs after $number are forwarded to init(). The most useful option is locale (or its alias lang), which selects the locale to use for formatting properties. Without it, the active system locale is used.
On success, returns the formatter object. On failure, it sets the class-level error, and returns undef in scalar context, or an empty list in list context.
METHODS
as_hash
my $self = $fmt->as_hash;
Returns the object itself. Module::Generic::Number::Format does not serialise to a plain hash; this method satisfies the Module::Generic API contract.
as_number
Inherited from Module::Generic. Returns the underlying numeric value as a plain Perl number (equivalent to $fmt->{_number} + 0).
as_string
my $str = $fmt->as_string;
Returns the internal _number value as a plain string without any formatting applied.
clone
my $fmt2 = $fmt->clone;
my $fmt2 = $fmt->clone( $other_number );
Returns a deep copy of the formatter. If $other_number is supplied, the clone's _number is set to that value instead of the original's. Infinity and NaN are rejected.
currency
my $symbol = $fmt->currency;
$fmt->currency( '¥' );
Alias for "symbol". Gets or sets the currency symbol used by "format_money".
decimal
my $sep = $fmt->decimal;
$fmt->decimal( ',' );
Gets or sets the decimal point character for non-monetary formatting.
Returns a Module::Generic::Scalar object.
decimal_fill
my $bool = $fmt->decimal_fill;
$fmt->decimal_fill(1);
Gets or sets the boolean flag that controls whether trailing zeroes are added to the decimal part to pad it to the requested precision. Defaults to 0.
When set to 1, format(2) on the value 3.1 produces "3.10" instead of "3.1".
decode_lconv
my $decoded = $fmt->decode_lconv( $lconv_hashref );
Decodes byte strings inside a hash reference returned by POSIX::localeconv() from the locale-native byte encoding (as reported by I18N::Langinfo::CODESET) to Perl's internal UTF-8. The grouping and mon_grouping keys, which are packed byte strings rather than text, are skipped.
Returns the hash reference with the decoded values in place, or undef on error.
default
my $href = $fmt->default;
$fmt->default( \%new_lconv );
Gets or sets the hash reference used as the source of locale data when populating formatting properties. By default this is the built-in $DEFAULT hash, which provides conservative, POSIX-compatible values. It is replaced by POSIX::localeconv()'s output during init() or set_locale().
encoding
my $enc = $fmt->encoding;
$fmt->encoding( 'ISO-8859-1' );
Gets or sets the character encoding used by "decode_lconv" when converting byte strings from POSIX::localeconv(). Defaults to utf-8.
format
my $str = $fmt->format;
my $str = $fmt->format( $precision );
my $str = $fmt->format( precision => 2, thousand => ',', decimal => '.' );
my $str = $fmt->format( precision => 2, decimal_fill => 1, grouping => 3 );
$n->format(
precision => 2,
# Override object value
thousand => ',',
decimal => '.',
# Boolean
decimal_fill => 1,
);
Formats the stored number with digit grouping (thousands separators) and decimal rounding.
If the number is too large or great to work with as a regular number, but instead must be shown in scientific notation (such as "1.23e+45"), returns that number in scientific notation without further formatting.
Module::Generic::Number->new("0.000020000E+00")->format(7); # 2e-05
It returns a scalar object upon success, or sets an error and returns undef in scalar context or an empty list in list context if an error occurred.
$precision (integer) controls the number of decimal places. If omitted, the value of "precision" is used.
Named options override the corresponding instance properties for this call only:
precision-
Number of decimal digits. Defaults to "precision".
thousand-
Thousands separator. Defaults to "thousand".
decimal-
Decimal point character. Defaults to "decimal".
decimal_fill-
Boolean. When true, the decimal part is padded with trailing zeroes to
$precisiondigits. Defaults to "decimal_fill". grouping-
Digit group size (typically
3). Defaults to "grouping", or3if that is not set.
format_binary
# Assuming the number object is 1000
$n->format_binary # 1111101000
Returns a Module::Generic::Scalar containing the stored number expressed in binary (base 2) notation, using sprintf '%b'. No locale formatting is applied.
format_bytes
# Assuming the number object is 1,234,567
$n->format_bytes # 1.18M
my $str = $fmt->format_bytes( precision => 2, mode => 'iec60027' );
my $str = $fmt->format_bytes( unit => 'M', base => 1000 );
Provided with an hash or hash reference of options, and the stored number as a human-readable byte count with an appropriate SI or IEC suffix, such as K, M or G depending if it exceeds gigabytes, megabytes or kilobytes; or the IEC standard 60027 KiB, MiB, or GiB depending on the option mode
It returns a scalar object upon success or an error if an error occurred.
The number must be non-negative.
Named options:
base-
The multiplier base. Defaults to
1024. Use1000for SI-decimal sizes. Any positive integer is accepted, provided$base ** 3does not overflow a 53-bit mantissa.If the mode (see below) is set to
iecoriec60027then setting thebaseoption returns an error. mode-
Either
traditional(the default) oriec60027(or the abbreviationiec). Traditional mode uses the "kilo_suffix", "mega_suffix", and "giga_suffix" strings (default:K,M,G). IEC 60027 mode uses "kibi_suffix", "mebi_suffix", and "gibi_suffix" (default:KiB,MiB,GiB). Thebaseoption is not permitted in IEC mode. precision-
Number of decimal places in the result. Defaults to "precision", or
2. unit-
By default, this is guessed based on the value of the number, but can be explicitly specified here.
In other words, numbers greater than or equal to 1024 (or other number given by the
baseoption) will be divided by 1024 and suffix set with "kilo_suffix" or "kibi_suffix" added; if greater than or equal to 1048576 (1024*1024), it will be divided by 1048576 and suffix set with "mega_suffix" or "mebi_suffix" appended to the end; etc.Possible values are:
auto(default),kilo,mega,gigaIf a value other than
autois specified, that value will be used instead no matter the number. For example:Module::Generic::Number->new( 1048576 )->format_bytes( unit => 'k' ); # Produces 1,024K and not 1M
format_hex
# Assuming the number object is 1000
$n->format_hex # 0x3E8
Returns a Module::Generic::Scalar containing the stored number expressed in uppercase hexadecimal with a 0x prefix (sprintf '0x%X'). No locale formatting is applied.
format_money
Provided with an optional precision, and an optional currency symbol and this format the number accordingly. It uses the object initial value set with "precision" and "currency" if not explicitly specified. object, using the inital format parameters specified during object instantiation.
# Assuming the number object is 1000
$n->format_money # € 1,000.00
$n->format_money(3) # € 1,000.000
The digit grouping, thousand separator and decimal separator are taken from the monetary trio ("mon_grouping", "mon_thousand", "mon_decimal"), which follows the LC_MONETARY category of the locale. Under "posix_strict" (the default), this is independent from the plain number formatting used by "format", so on a mixed locale such as LC_NUMERIC=C with LC_MONETARY=en_US.UTF-8, money is grouped even though a plain number is not. The currency symbol and sign placement always follow the monetary category.
The sign and symbol placement (before or after the value, with or without a space) follow the POSIX locale properties accessed via "position_pos", "position_neg", "precede", "precede_neg", "space_pos", "space_neg", "sign_pos", and "sign_neg".
It returns a scalar object upon success or an error if an error occurred.
format_negative
my $str = $fmt->format_negative;
my $str = $fmt->format_negative( '(x)' );
$n->format_negative( '(x)' ); # (1,000)
Formats the stored number (formatted with default precision) using a negative format picture. The picture must contain the letter x, which is replaced by the absolute formatted value. For example, a picture of -x produces -1,234.56, while (x) produces (1,234.56). If no picture is supplied, the value of "neg_format" is used.
It returns a scalar object upon success or an error if an error occurred.
format_picture
$n->format_picture( '##,###.##' ); # 1,000.00
my $str = $fmt->format_picture( picture => '#,###.##' );
Formats the stored number against a picture template. Returns a Module::Generic::Scalar. The picture uses # as a digit placeholder; any other character in the picture is kept as-is. The decimal point in the picture must match "decimal".
If the integer part of the number is too large to fit in the available # positions, all # characters are replaced with * and the overflow picture is returned.
For examples:
# Assuming 100023
$n->format_picture( 'EUR ##,###.##' ); # EUR **,***.**
# Assuming 1.00023
$n->format_picture( 'EUR #.###,###' ); # EUR 1.002,300
Leading zeroes in the integer part are stripped. The sign prefix, if any, is repositioned to the left of any non-digit prefix character.
The comma , and period . used in the example above are taken from the value set with "thousand" and "decimal" respectively. However, the thousand characters in the picture provided, does not need to occur every three digits; the only use of that variable by this function is to remove leading commas (see the first example above).
There may not be more than one instance of decimal in the picture provided though, or an error will be returned.
It returns a scalar object upon success or an error if an error occurred.
gibi_suffix
my $s = $fmt->gibi_suffix;
$fmt->gibi_suffix( 'GiB' );
Gets or sets the IEC gibibyte suffix used by "format_bytes" in iec60027 mode. Defaults to GiB.
giga_suffix
my $s = $fmt->giga_suffix;
$fmt->giga_suffix( 'G' );
Gets or sets the gigabyte suffix used by "format_bytes" in traditional mode. Defaults to G.
grouping
my $n = $fmt->grouping;
$fmt->grouping(3);
Gets or sets the digit group size (the number of digits between thousands separators). Sourced from POSIX::localeconv()->{grouping}. Defaults to 3. Returns a Module::Generic::Scalar object.
kibi_suffix
my $s = $fmt->kibi_suffix;
$fmt->kibi_suffix( 'KiB' );
Gets or sets the IEC kibibyte suffix used by "format_bytes" in iec60027 mode. Defaults to KiB.
kilo_suffix
my $s = $fmt->kilo_suffix;
$fmt->kilo_suffix( 'K' );
Gets or sets the kilobyte suffix used by "format_bytes" in traditional mode. Defaults to K.
lang
my $loc = $fmt->lang;
$fmt->lang( 'fr_FR' );
Gets or sets the locale string. This is an alias of "locale"; they both access the same underlying lang field. Setting this value does not automatically re-read POSIX::localeconv(); use "set_locale" for that.
Returns a Module::Generic::Scalar object.
locale
Alias of "lang".
mebi_suffix
my $s = $fmt->mebi_suffix;
$fmt->mebi_suffix( 'MiB' );
Gets or sets the IEC mebibyte suffix used by "format_bytes" in iec60027 mode. Defaults to MiB.
mega_suffix
my $s = $fmt->mega_suffix;
$fmt->mega_suffix( 'M' );
Gets or sets the megabyte suffix used by "format_bytes" in traditional mode. Defaults to M.
mon_decimal
my $sep = $fmt->mon_decimal;
$fmt->mon_decimal( ',' );
Gets or sets the decimal point character specifically for monetary formatting (sourced from POSIX::localeconv()->{mon_decimal_point}). Falls back to "decimal" when empty.
Returns a Module::Generic::Scalar object.
mon_grouping
my $n = $fmt->mon_grouping;
$fmt->mon_grouping(3);
Gets or sets the digit group size for monetary formatting (sourced from POSIX::localeconv()->{mon_grouping}). Falls back to "grouping" when empty.
Returns a Module::Generic::Scalar object.
mon_thousand
my $sep = $fmt->mon_thousand;
$fmt->mon_thousand( '.' );
Gets or sets the thousands separator for monetary formatting (sourced from POSIX::localeconv()->{mon_thousands_sep}). Falls back to "thousand" when empty.
Returns a Module::Generic::Scalar object.
neg_format
my $fmt_str = $fmt->neg_format;
$fmt->neg_format( '(x)' );
Gets or sets the picture string used by "format_negative" and "unformat" to represent negative numbers. The picture must contain exactly one x, which stands for the absolute formatted value. Common values are -x (the default) and (x).
Returns a Module::Generic::Scalar object.
posix_strict
my $bool = $fmt->posix_strict;
$fmt->posix_strict(1);
Gets or sets the boolean that controls which locale property map is used when populating formatting properties from POSIX::localeconv(). When true (the default), the strict POSIX map is used, which does not fall back across numeric and monetary properties. When false, a flexible map is used that allows cross-category fallbacks (for example, decimal_point falling back to mon_decimal_point when the numeric value is empty).
position_neg
my $n = $fmt->position_neg;
$fmt->position_neg(1);
Gets or sets the position of the sign symbol (typically "-") relative to the currency symbol and value for negative monetary amounts. Corresponds to POSIX::localeconv()->{n_sign_posn}. Accepted values:
0-
Parentheses surround the entire string.
1-
Sign appears before the string.
2-
Sign appears after the string.
3-
Sign appears immediately before the currency symbol.
4-
Sign appears immediately after the currency symbol.
Returns a Module::Generic::Scalar object.
position_pos
my $n = $fmt->position_pos;
$fmt->position_pos(1);
Gets or sets the sign (typically "", i.e. empty, but could be set to "+") position for non-negative monetary values. Corresponds to POSIX::localeconv()->{p_sign_posn}. See "position_neg" for the accepted values. Returns a Module::Generic::Scalar object.
precede
my $bool = $fmt->precede;
$fmt->precede(1);
Gets or sets whether the currency symbol precedes (1) or follows (0) the value for non-negative monetary amounts. Corresponds to <POSIX::localeconv()-{p_cs_precedes} >>. Returns a Module::Generic::Scalar object.
precede_neg
my $bool = $fmt->precede_neg;
$fmt->precede_neg(1);
Gets or sets whether the currency symbol precedes or follows the value for negative monetary amounts. Corresponds to POSIX::localeconv()->{n_cs_precedes}. Returns a Module::Generic::Scalar object.
precede_pos
Alias for "precede".
precision
# Assuming $n is an object for 3.14159265358979323846
$n->precision(4);
$n->format # 3.1416
my $n = $fmt->precision;
$fmt->precision(2);
Gets or sets the number of decimal digits used by "format" and "format_money" when no explicit precision argument is supplied. Sourced from POSIX::localeconv()->{frac_digits}. Returns a Module::Generic::Scalar object.
round
my $fmt2 = $fmt->round( $precision );
Returns a new Module::Generic::Number::Format with the stored number rounded to $precision decimal places using sprintf '%.*f'. $precision must be a non-negative integer. On success, returns the new formatter. On failure, returns undef and sets the error.
round_zero
my $fmt2 = $fmt->round_zero;
This will round the number using "round" in POSIX, which will return "the integer (but still as floating point) nearest to the argument"
Returns a new formatter with the stored number as an "integer (but still as floating point) nearest to the argument", with ties rounded away from zero (POSIX::round() semantics). On Perl 5.22 and later, delegates to POSIX::round(). On earlier versions, the result is computed as int( abs($n) + 0.5 ) with the original sign reapplied.
round2
my $fmt2 = $fmt->round2( $precision );
Returns a new formatter with the stored number rounded to $precision decimal places using a multiplier-based algorithm that avoids the floating-point artefacts common with sprintf. $precision must be a non-negative integer. Supports Math::BigFloat values. Returns undef and sets the error if the intermediate product would overflow a 53-bit mantissa; in that case, use a smaller precision or switch to Math::BigFloat.
set_locale
my $locale_str = $fmt->set_locale( 'fr_FR' );
my $locale_str = $fmt->set_locale( 'ja_JP.UTF-8' );
Changes the formatter's locale and updates all formatting properties to match the new locale. Returns the canonical locale string that was accepted by POSIX::setlocale(), or undef on error.
The method temporarily changes LC_ALL to the requested locale in order to call POSIX::localeconv(), then restores LC_ALL to its original value before returning, so the process locale is never left in a modified state.
If a bare language code such as fr_FR is supplied (no encoding suffix), the method tries it as-is first, then iterates over the known encoding variants in $SUPPORTED_LOCALES (such as fr_FR.UTF-8, fr_FR.ISO-8859-1, etc.) until one is accepted by the system.
On failure, the method returns undef and sets the error to a descriptive message. It does not partially update formatting properties; the call either succeeds completely or leaves the formatter unchanged.
sign_neg
my $s = $fmt->sign_neg;
$fmt->sign_neg( '-' );
Gets or sets the sign character used to denote negative currency values, usually a minus sign. Corresponds to POSIX::localeconv()->{negative_sign}.
Returns a Module::Generic::Scalar object.
sign_pos
my $s = $fmt->sign_pos;
$fmt->sign_pos( '+' );
Gets or sets the sign character used to denote non-negative currency values, usually the empty string. Corresponds to POSIX::localeconv()->{positive_sign}. Typically the empty string.
Returns a Module::Generic::Scalar object.
space_neg
my $n = $fmt->space_neg;
$fmt->space_neg(0);
Gets or sets the spacing rule between the sign or currency symbol and the value for negative monetary amounts. Corresponds to POSIX::localeconv()->{n_sep_by_space}. Accepted values:
0-
No space between symbol and value.
1-
Space between symbol and value, no space between sign and symbol.
2-
Space between sign and symbol, no space between symbol and value.
Returns a Module::Generic::Scalar object.
space_pos
my $n = $fmt->space_pos;
$fmt->space_pos(0);
Gets or sets the spacing rule for non-negative monetary amounts. Corresponds to POSIX::localeconv()->{p_sep_by_space}. See "space_neg" for the accepted values.
Returns a Module::Generic::Scalar object.
symbol
my $sym = $fmt->symbol;
$fmt->symbol( '¥' );
Gets or sets the currency symbol used by "format_money". Sourced from POSIX::localeconv()->{currency_symbol}. The method currency is an alias. Returns a Module::Generic::Scalar object.
thousand
my $sep = $fmt->thousand;
$fmt->thousand( '.' );
Gets or sets the thousands separator for non-monetary formatting. Sourced from POSIX::localeconv()->{thousands_sep}. Returns a Module::Generic::Scalar object.
unformat
my $fmt2 = $fmt->unformat( '1.234.567,89' );
my $fmt2 = $fmt->unformat( '1.2 M', base => 1000 );
my $n = Module::Generic::Number::Format->unformat('USD 12.95'); # 12.95
# Same
my $n = $n1->unformat('USD 12.95'); # 12.95
my $n = Module::Generic::Number::Format->unformat('USD 12.00'); # 12
my $n = Module::Generic::Number::Format->unformat('foobar'); # return error (undef)
my $n = Module::Generic::Number::Format->unformat('1234-567@.8'); # 1234567.8
Strips locale-specific formatting from a number string and returns a new formatter whose _number is set to the resulting raw numeric value.
The method recognises the current "decimal", "neg_format", and the kilo, mega, and giga suffix strings (both traditional and IEC variants). Numbers that end with a suffix are multiplied by the corresponding multiplier (see "format_bytes" for the base option). Only one decimal separator is permitted; the presence of more than one is an error.
It returns an error if the string provided does not contain any number.
SERIALISATION
The class implements FREEZE / THAW for Sereal and CBOR::XS, and STORABLE_freeze / STORABLE_thaw for Storable. Only the fields listed in _fields plus the formatting property keys are preserved; code references, DBI handles, and other process-local state are excluded. The TO_JSON method returns the raw number so that JSON serialisers produce a numeric value rather than a stringified object.
SUPPORTED LOCALES
The package variable $Module::Generic::Number::Format::SUPPORTED_LOCALES is a hash reference mapping bare locale codes (such as fr_FR) to an array of known encoding variants in decreasing order of preference (such as fr_FR.UTF-8, fr_FR.ISO-8859-1, fr_FR.ISO8859-1). It covers several hundred locales commonly found on Linux and macOS systems.
This table is used only when a bare code without an encoding suffix is supplied to "set_locale" and the code is not accepted as-is by POSIX::setlocale().
DEPENDENCIES
Module::Generic, POSIX (core), Scalar::Util (core), Encode (core), I18N::Langinfo (core).
Optional: threads and threads::shared (used automatically when the Perl interpreter was built with thread support).
SEE ALSO
Module::Generic::Number: the lightweight numeric object that uses this module for formatting via lazy loading.
Module::Generic: the base class providing error handling, accessor helpers, and object infrastructure.
POSIX: setlocale() and localeconv() for locale data.
AUTHOR
Jacques Deguest <jack@deguest.jp>
COPYRIGHT & LICENCE
Copyright (c) 2026 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.