Download the PHP package kwn/number-to-words without Composer

On this page you can find all versions of the php package kwn/number-to-words. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package number-to-words

PHP Number to words converter

CircleCI Code Climate Test Coverage Latest Stable Version

Welcome to number-to-words, a PHP utility that seamlessly transforms numeric values into their corresponding words. Effortlessly convert numbers, such as 123, into expressive and readable formats like "one hundred and twenty-three" with just a few lines of code.

Installation

Add package to your composer.json by running:

Usage

There are two types of number-to-words transformation: number and currency. In order to use a relevant transformer for specific language create an instance of NumberToWords class and call a method that creates a new instance of the desired transformer;

Number Transformer

Create a transformer for specific language using the getNumberTransformer('lang') method:

Transformer can be used by passing in numeric values to the toWords() method:

It can be also used with a static method:

Currency Transformer

Creating a currency transformer works just like a number transformer.

Then it can be used passing in numeric values for amount and ISO 4217 currency identifier to the toWords() method:

It can be also used with a static method:

Note: The Currency Transformer within this library processes integers; ensure your input amounts are in whole numbers by multiplying any float values by 100 before transformation. For instance, transform 45.67 by using 4567 as the input for accurate currency conversion.

Available locale

Language Identifier Number Currency
Albanian al + +
Arabic ar + +
Azerbaijani az + +
Belgian French fr_BE + -
Brazilian Portuguese pt_BR + +
Bulgarian bg + +
Czech cs + -
Danish dk + +
Dutch nl + -
English en + +
Estonian et + -
Georgian ka + +
German de + +
French fr + +
Hungarian hu + +
Indonesian id + +
Italian it + -
Kurdish ku + -
Lithuanian lt + +
Latvian lv + +
Macedonian mk + -
Malay ms + +
Persian fa + -
Polish pl + +
Romanian ro + +
Serbian sr + +
Slovak sk + +
Spanish es + +
Russian ru + +
Swedish sv + -
Turkish tr + +
Turkmen tk + +
Ukrainian ua + +
Uzbek uz + +
Yoruba yo + +

Contributors

Some transformers were ported from the pear/Numbers_Words library. Others were created by contributors. Thank you!

Version 2.x - BC and major changes

Questions and answers

Q: What should I do if I encounter a bug while using the library?

A: If you come across a bug, please open an issue on our GitHub repository. As I may not be proficient in all languages, we encourage users to submit fixes and collaborate to enhance the library's functionality.

Q: My language is missing. Could it be added?

A: There's a high chance I don't know your language. Feel free to implement the missing language and open a pull request. You can use the existing languages as a reference.


All versions of number-to-words with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kwn/number-to-words contains the following files

Loading the files please wait ....