PHP Classes

File: cwordstonumbers/README.txt

Recommend this page to a friend!
  Classes of Mohammed Asad   PHP Convert Words to Numbers   cwordstonumbers/README.txt   Download  
File: cwordstonumbers/README.txt
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Convert Words to Numbers
Convert text with an amount to its numeric value
Author: By
Last change: added language support details
cWordsToNumber files moved to new Repo
Date: 7 years ago
Size: 1,621 bytes


Class file image Download


This class is created for converting the words( that represents the digits) to numbers again like thousand to 1000, hundred to 100 or so.

The main purpose for creating this class is just to help someone who was looking for this and I also had lot of free time.

CHALLENGES faced to make this work:

-- changing the order of the words and the different probability of words order.

-- Committing spelling mistakes or using extra gaps or unwanted characters.

-- Using indian and western system together (like billion crore). :P


-- It can automatically detect the entered number system either be indian or western.

-- This can also help to get the digits for terms like twelve hundred or twenty five hundred.

-- You can also find the sum of the numbers by typing them like (eg.twelve hundred and twelve hundred and twenty three hundred),well it know its the hard way, but still you can do it.

-- It can format automatically based on the detected number system if the formatting is enabled.

-- Pretty simple to use, it. Just create and object and call the displayNumbers method.


-- Indian number system limit is till ninty nine lakh crore and ninty nine lakh and so on. (99,99,999,99,99,999)

-- Western number system limit is till nine hundred and ninty nine billion and so one (999,999,999,999)

-- Using wrong ordered words might create a chaos (I am not responsible if your machine explodes)

-- Currently Supports only ENGLISH LANGUAGE