nineteenfeet / nf-number-to-word
将数字转换为它的文字表示。例如:1 => one
2.0.0
2023-06-16 12:56 UTC
Requires
- php: >=8.1
Requires (Dev)
- overtrue/phplint: ^9.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.2
- slevomat/coding-standard: ^8.12
- squizlabs/php_codesniffer: ^3.7
README
此组件提供了一种将数字(例如 1023
)转换为字符串(例如 one thousand and twenty three
)的方法。它还提供了一个名为 numberToWord 的 laminas-view 辅助函数。
使用 Composer 安装
$ composer require "nineteenfeet/nf-number-to-word"
用法
use NFNumberToWord\NumberToWords; $number = 1999; $numberToWords = new NumberToWords(); $string = $numberToWords->toWords($number);