numbers into word

Results 1 to 2 of 2

Thread: numbers into word

  1. #1
    Join Date
    Dec 1969

    Default numbers into word

    How can I have numbers into word... I have the script to convert numbers without decimals into word. But How do I convert numbers to word with decimals. eg. I have this figure: 1234.60 I want it as One thousand two hundred and thirty four and cents sixty only. Please guide me...

  2. #2
    Join Date
    Dec 1969

    Default I have a demo...<BR><BR>It doesn&#039;t do the cents, but that&#039;s easy:<BR><BR>Just take the integer part first, call the function to get the words for the dollars. Then subtract the integer from the original number and multiply the result by 100 and round. That gives you the cents, and you call the routine again.<BR><BR>&#060;%<BR>cost = 1234.60<BR>dollars = Int( cost )<BR>cents = Round( 100 * ( cost - dollars ) )<BR>strCost = NumberToWords( dollars ) & " dollars and " & NumberToWords( cents ) & " cents only"<BR>%&#062;<BR><BR>I forget if that is the name of that function in my demo, but you can adjust as needed.<BR><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