WireNumberTools::locale() method

Get a number formatting property from current locale

In multi-language environments, this method’s return values are affected by the current language locale.

Usage

// basic usage
$array = $wireNumberTools->locale();

// usage with all arguments
$array = $wireNumberTools->locale(string $key = '');

Arguments

NameType(s)Description
key (optional)string

Property to get or omit to get all properties. Properties include:

  • decimal_point: Decimal point character
  • thousands_sep: Thousands separator
  • currency_symbol: Local currency symbol (i.e. $)
  • int_curr_symbol: International currency symbol (i.e. USD)
  • mon_decimal_point: Monetary decimal point character
  • mon_thousands_sep: Monetary thousands separator
  • positive_sign: Sign for positive values
  • negative_sign: Sign for negative values
  • clear: Clear any cached values for current language/locale.
  • See https://www.php.net/manual/en/function.localeconv.php for more.

Return value

array string int null


WireNumberTools methods and properties

API reference based on ProcessWire core version 3.0.228

Latest news

  • ProcessWire Weekly #499
    In the 499th issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, introduce a new third party module called RockPdf, and more. Read on!
    Weekly.pw / 3 December 2023
  • Using date range fields in ProcessWire
    This week we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield.
    Blog / 24 November 2023
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits