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  ;
* t – will be  
== 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]
mediawiki/format-num 适用场景与选型建议
mediawiki/format-num 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 11 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「numbers」 「mediawiki」 「Formating」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mediawiki/format-num 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mediawiki/format-num 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mediawiki/format-num 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
An extension to Semantic MediaWiki allowing to build breadcrumb links from an attributive property filter
Helper functions for the MediaWiki ExtensionRegistry
Adds the EDTF data type to Wikibase
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Partition problem for balanced arrays splitting made easy.
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2014-11-07