Decaflon

Welcome to Decaflon! Where the geeks hang out: Signup or Login Here
Decaflon is proudly hosted by (mt) Media Temple.  We recommend them for your web hosting needs.
Clips: Popular Clips Upcoming Clips Notes: All Notes

Does anyone know a way to convert a number to its text form without using an infinitely long array? I've looked high and low and can't find a single thing in Google. It seems like it'd be pretty difficult to make a trustworthy algorithm for.

(I can't seem to edit notes. Responses are fine, but not the first note.)

The reason I'm asking is to use it for CSS classes. Although, I could probably just use "num1", "num2", and so on. Still interested in a response to this though.

username Zoom

Oli

Written Jun. 1, 2008 / Report /

An infinite array would be thoroughly unnecessary as numerical nomenclature does adhere to programmable rules.

Googling "convert number to word php" will show you the way. Knock off the php for some JS methods of doing it.

A couple people pointed me here and here. I've since gone with num1, num2, etc., for the sake of simplicity, but there're the solutions.

Oli: That "infinite array" wasn't a serious suggestion. ;)

Please Login To Leave A Comment

Decaflon Sponsors Get in touch if you want in.

Hot Notes (View all »)

 

Decaflon is part of the Chawlk Network of sites.

9 Great Places To Visit, Hang Out, & Meet New People

What's new and interesting at other Chawlk Network sites: