2017 © Pedro Peláez
 

library number-converter

A tool to convert numbers to their written lingual form.

image

drrcknlsn/number-converter

A tool to convert numbers to their written lingual form.

  • Wednesday, December 3, 2014
  • by drrcknlsn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

NumberConverter

NumberConverter is a simple interface for converting numbers from their numeric representations into their written, lingual representations. Other, probably better solutions already exist (see below), and this was created only as a coding exercise., (*1)

Example

$converter = new DrrckNlsn\NumberConverter\EnglishNumberConverter();
echo $converter->convert(1234567);

Output:, (*2)

one million two hundred thirty four thousand five hundred sixty seven

Internationalization

Currently, there is only an EnglishNumberConverter implementation, but the project was created with other languages in mind., (*3)

Demo

This package comes with a simple CLI binary for demonstrating the EnglishNumberConverter class, located at bin/convertNumber., (*4)

Installing via Composer

The recommended way to install NumberConverter is via Composer:, (*5)

composer require drrcknlsn/number-converter

After installing the dependency, you will need to require Composer's autoloader:, (*6)

require 'vendor/autoload.php';

Existing Solutions

The intl extension provides the NumberFormatter class, which can be used to accomplish the same goal, using NumberFormatter::SPELLOUT., (*7)

The Versions

03/12 2014

dev-master

9999999-dev https://github.com/drrcknlsn/number-converter

A tool to convert numbers to their written lingual form.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Derrick Nelson

converter number