sicaa/number-to-fr-words
最新稳定版本:1.0.1
Composer 安装命令:
composer require sicaa/number-to-fr-words
包简介
Simple and effective lib to convert number into french words
README 文档
README
English
I've written this tiny library to easily transform a number into french words. This project came up when I had to automatically write on bank checks for a client. At this time, the only solution was to use an old and heavy Pear package (https://pear.php.net/package/Numbers_Words). Naturally, the following documentation is therefore written in French.
Français
Lib PHP simple pour convertir un nombre en mots (français). Ce projet a vu le jour lorsque j'ai eu besoin d'écrire automatiquement sur des chèques bancaires pour un client. À l'époque, la seule solution aurait été d'utiliser une ancienne lib Pear (https://pear.php.net/package/Numbers_Words).
Utilisation
composer require sicaa/number-to-fr-words
<?php use Sicaa\NumberToFrWords\NumberToFrWords; var_dump(NumberToFrWords::output(1337)); // string(29) "mille trois cent trente-sept"
Limitations
Le nombre maximal supporté dépend de la plateforme sur laquelle est utilisée l'outil. Au délà de la valeur de PHP_INT_MAX, PHP interprète l'entier en tant que nombre décimal (voir http://php.net/manual/fr/language.types.integer.php). La classe ne prenant pas en charge les nombres non entiers, sur un support 64-bit, le nombre maximal pris en charge est 9223372036854775807.
<?php var_dump(NumberToFrWords::output(9223372036854775807)); // string(192) "neuf quintillions deux cent vingt-trois quadrillions trois cent soixante-douze trillions trente-six milliards huit cent cinquante-quatre millions sept cent soixante-quinze mille huit cent sept" var_dump(NumberToFrWords::output(9223372036854775808)); // Fatal error: Uncaught exception 'Exception' with message 'NumberToFrWords::output: $number must be an integer'
统计信息
- 总下载量: 10.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-06