Welcome to Nigeria Oil & Gas Forum. Feel free in using the Forum, Reply to Posts, Participate in Discussions, Make your Requests, Ask your Questions,

Author Topic: Converting Numbers into their Word Equivalent  (Read 1039 times)

Offline osofem

  • Moderator
  • Newbie
  • *****
  • Posts: 28
  • What do you think +1/-0
  • Gender: Male
  • I am Osofem. I program. That is just me
    • View Profile
Converting Numbers into their Word Equivalent
« on: May 02, 2013, 12:42:01 PM »
I am currently working on a forum site which surely has numbers in various places representing different things. Being a slightly tidy guy , I strive to make the numbers look trimmed by formatting them with number_format ("putting the integers into comma"). But taking a step further, I decided to add a mouse-over effect to spell out the numbers (i.e., when you point on "12, 345 user online" the title attribute reads "Twelve Thousand, Three Hundred and Forty Five users online"). What I came up with can convert any positive integer up to (1x1064)-1 to it word equivalent though the number has to be entered as a string if it is greater than PHP_INT_MAX to prevent PHP from exponenting it (i.e. changing 2000 to 2e3).

Continue here on Codeproject

Nigeria Oil & Gas Forum

Converting Numbers into their Word Equivalent
« on: May 02, 2013, 12:42:01 PM »


Related Topics

  Subject / Started by Replies Last post
0 Replies
Last post July 19, 2015, 11:57:03 AM
by guagecon
0 Replies
Last post September 19, 2015, 05:15:57 PM
by legalmoney
0 Replies
Last post September 20, 2016, 04:11:10 AM
by pintogen
0 Replies
Last post January 16, 2017, 11:56:25 AM
by segiade

Sponsored Ads

Quick Links

About Us
Contact us
Privacy Policy

Contact Info

Nigeria Oil & Gas Forum

Email Address
Contact Form
Business Hours
9.00am - 5.00pm (Mon - Sat)

Would you like to partner with us on this forum?

Then you can contact us here

Nairaland     Oil Prices     UK Gas Forum     Ghana Gas Forum     Russian Oil & Gas Forum     Israel Oil Forum     Agric Forum      freeslots.la

Powered by EzPortal