Converting numbers into words - Bill need yur help

# Thread: Converting numbers into words - Bill need yur help

1. Senior Member
Join Date
Dec 1969
Posts
468

## Converting numbers into words - Bill need yur help

Bill replied to my post - showed demo as to how to convert numbers into words. how can I modify the code, If it has to be printed in dollars and cents ?<BR><BR>if numbers are <BR>678999.67<BR>or <BR>450.34<BR><BR>Thanks in advance<BR>

2. Senior Member
Join Date
Dec 1969
Posts
2,958

http://www.barasch.com/excel/cCo11432.htm

3. Senior Member
Join Date
Dec 1969
Posts
468

## RE: thanks - but its rounding cents

when I enter 45.90 - it is rouding the value in words as<BR>forty six dollars.

4. Senior Member
Join Date
Dec 1969
Posts
2,958

I ccould google for you all night but it&#039;s late and I&#039;m tired now. Can you Google too?<BR><BR>http://developer.asna.com/Articles/b000106.asp

5. Senior Member
Join Date
Dec 1969
Posts
5,955

## If you put a link to the post...

...you&#039;re referring to, other people than Bill might be able to help and you might get your problem solved much more quickly.<BR><BR>As it stands, I have no idea how to modify the code since I don&#039;t have the code in front of me.<BR><BR>Oliver.

6. Senior Member
Join Date
Dec 1969
Posts
96,118

## Easy...

For those curious, the basic code is shown here:<BR>http://www.clearviewdesign.com/Newbie/Demos/NumToWords.asp<BR><BR>*************<BR><BR>You just do the cents *SEPARATELY*!!!<BR><BR>So something like this:<BR><BR>&#060;%<BR>Function DollarsToWords( amount )<BR> Dim dollars, cents, words<BR><BR> &#039; first, get the even dollars:<BR> dollars = Int( amount )<BR> &#039; then get the cents [strip off collars, mult by 100, round]<BR> cents = Round( 100 * ( amount - dollars ) )<BR><BR> &#039; then use NumberAsWord as needed:<BR> words = NumberAsWord( dollars ) & " dollars"<BR><BR> If cents = 0 Then<BR> words = words & ", exactly"<BR> Elseif cents = 1 Then &#039; special case so no "s" on cent<BR> words = words & " and one cent"<BR> Else<BR> words = words & " and " & NumberAsWord( cents ) & " cents"<BR> End If<BR><BR> DollarsToWords = words<BR>End Function<BR>%&#062;<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•