定制 mediawiki/format-num 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mediawiki/format-num

最新稳定版本:v0.6.2

Composer 安装命令:

composer require mediawiki/format-num

包简介

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.

README 文档

README

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.

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

== Examples ==
:{{#formatnum: 2300.123|2|,|_}}
:result: 2 300,12

:{{#formatnum: 2300.123|2|.|,}}
:result: 2,300.12

:{{#formatnum: 2300.123|2}}
:result: 2,300.12

:{{#formatnum: 2300.123|2|,|t}}
:result: 2 300,12

As ''thousand separator'' the following parameters can be also used
* n – will be &nbsp&#59;
* t – will be &thinsp&#59;

== Installation ==
Download the files from github. Put them in /extensions/FormatNum and add the following to your [[LocalSettings.php]]
<syntaxhighlight lang=php>require_once( "$IP/extensions/FormatNum/FormatNum.php" );</syntaxhighlight>

== Use Example ==
On Wikipedia formatting of numbers is done with complex templates like [[🇩🇪Vorlage:FormatZahl|this]]. With the #formatnum parser this would be a lot easier.

== See also ==
* [[Extension:NumberFormat]]
* [[Bugzilla:40422]] - review and deployment request

== Links ==
* [http://www.php.net/manual/en/function.number-format.php description of number_format at php.net]

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2014-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固