Converts numbers into words in French (FR_fr) up to 999,999,999,999,999,999.
To install this library, you can add it as a dependency to your project using Composer:
composer require mv/number-words-fr-converter
To use the library, create an instance of IntToWordsFrConverter and call the convert method:
use Mv\NumberWordsFr\Converter\IntToWordsFrConverter;
$converter = new IntToWordsFrConverter();
$result = $converter->convert(12345);
echo $result; // "douze mille trois cent quarante-cinq"
Other locales
use Mv\NumberWordsFr\Converter\IntToWordsFrBeConverter;
use Mv\NumberWordsFr\Converter\IntToWordsFrCaConverter;
$converter = new IntToWordsFrBeConverter();
$resultBe = $converter->convert(72);
$converter = new IntToWordsFrCaConverter();
$resultCa = $converter->convert(72);
echo $resultBe; // "Septante-deux"
echo $resultCa; // "Soixante-douze"
Exists with Fr, FrBe, FrCh, FrCa, FrLu, FrMa, FrTn
Converts an integer into words.
$int
: The integer to convert into words.
Any contributions, suggestions, or bug reports are welcome! Here's how you can contribute:
- Fork the repository.
- Create a branch for your changes:
git checkout -b feature/my-feature
. - Make your changes and commit:
git commit -am 'Added my feature'
. - Push to the branch:
git push origin feature/my-feature
. - Create a pull request to the concerned branch of the repository.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.