Extension:Numbertext

From MediaWiki.org
Jump to: navigation, search

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎中文
MediaWiki extensions manual
Crystal Clear action run.png
Numbertext

Release status: stable

Implementation Parser function
Description Allows to transform numbers into words
Author(s) Pavel Astakhov (Pastakhovtalk)
Latest version 0.10.0 (2014-04-01)
PHP 5.3+
Database changes No
License LGPL/BSD dual-license
Download
Example test.foxway.org
Parameters
  • $wgNumbertext_defaultLang
  • $wgNumbertextLang
Hooks used
ParserFirstCallInit

Translate the Numbertext extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The Numbertext extension allows to transform numbers into words. It based on the numbertext.org service and supports more than thirty languages.

Usage[edit | edit source]

  • {{#numbertext:number|language}}
  • {{#moneytext:number|currency|language}}

where:

  1. number - the number to transform into words
  2. currency - currency of money (sample: "USD", "EUR", "RUB", etc)
  3. language - language for transform (optional, sample "en", "en_US", "ru", "ru_RU", etc)

Default language sets by variable $wgNumbertext_defaultLang, which by default equally $wgLanguageCode (see Site language).

You can specify a different default language, or an empty string, and will use the language specified in the user preferences.

Installation[edit | edit source]

  • Download and extract the file(s) in a directory called Numbertext in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository using:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Numbertext.git
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/Numbertext/Numbertext.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.