Open main menu

Extension:FormatNum/pl

This page is a translated version of the page Extension:FormatNum and the translation is 40% complete.

Other languages:
Deutsch • ‎English • ‎català • ‎dansk • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎suomi • ‎中文 • ‎日本語
Podręcznik rozszerzeń MediaWiki
Crystal Clear action run.svg
FormatNum
Status wydania: stabilne
Realizacja Parser function
Opis Passes number formatting instruction to PHP function number_format
Autor(zy) Daniel Schuba (DaSchtalk)
Ostatnia wersja 0.6.2 (2014-11-07)
Licencja GNU General Public License 2.0 or later
Pobieranie
README
Użyte haki
ParserFirstCallInit
LanguageGetMagic
Przetłumacz rozszerzenie FormatNum jeżeli jest dostępne na translatewiki.net
Sprawdź wykorzystywanie i matrycę wersji.

Extension FormatNum makes it easier to format numbers in the style you want, independent of language settings. For input "english" format is used with point as decimal separator.

Contents

Usage

  • {{#formatnum:number|number of decimals|decimal separator|thousand separator|old thousand separator}}
  • {{#formatnum:number|decs=number of decimals|dsep=decimal separator|tsep=thousand separator|otsep=old thousand separator|format=DIN or ISO|mint=minimal number to separate thousands}}
  • otsep: thousands separator in the number given, that will be removed. For example when having a number like 123.456.789,123 and setting otsep=. will remove all points from the number before converting.
  • mint: the minimal number given to separate thousands. For example when setting to 4 the number 1234 will remain as is and 12345 will be separated to 12 345.

Przykłady

{{#formatnum: 2300.123|2|,|_}}
rezultat: 2 300,12
{{#formatnum: 2300.123|2|.|,}}
rezultat: 2,300.12
{{#formatnum: 2300.123|2}}
rezultat: 2,300.12
{{#formatnum: 2300.123|2|,|t}}
rezultat: 2 300,12

As thousand separator the following parameters can be also used

  • n – will be  
  • t – will be  

Repozytorium

Pobieranie

Download using Git

git clone https://github.com/DaSchTour/FormatNum.git

Instalacja

Download the files from GitHub. Put them in /extensions/FormatNum and add the following to your LocalSettings.php

require_once( "$IP/extensions/FormatNum/FormatNum.php" );

Use Example

On Wikipedia formatting of numbers is done with complex templates like this. With the #formatnum parser this would be a lot easier.

Zobacz też

Linki