Skip to Content
author's profile photo
Former Member

How to display invoice amount in word format

Post Author: xxxman1

CA Forum: General

I can display HKD$2,721.01 in my invoicebut how can I display Two thousand Seven Hundred and Twenty Seven Dollars and One Cents onlyPlease help!Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 01:58 PM

    Post Author: ShrikeAttack

    CA Forum: General

    Try the function ToWords? ToWords($2721.01, 2)

    ToWords (x, #places)

    I've never used it but it's in the CR help.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 02:03 PM

    Post Author: dmcheng

    CA Forum: General

    Hello. Try using the custom function at this link: http://www.crystalkeen.com/articles/crystalreports/currencyaswords.htm Text below, in case the link doesn't work. I didn't write this code, I found it on Google. He sent us a Crystal Reports version 9 report with a custom function called u201CChequeu201D to display a dollar amount in words:

    Function (currencyVar v1)

    Local CurrencyVar RoundCents := round(remainder(v1,1)*100);

    Local Stringvar Dollarpart := towords(int(v1),0);

    Local Stringvar Centspart := towords(int(RoundCents),0);

    if instr(dollarpart, "hundred") > 0

    then dollarpart := Replace (dollarpart,"hundred" ,"hundred and" );

    dollarpart + " dollars and " + centspart + " cents"

    You could modify the custom function to display Euros, Pounds, Yen, Pesos, Francs, Krone, Rupee, Baht, Rand etc.

    The custom function is then invoked in a formula as

    ProperCase(Cheque( {table.currencyfield}))

    Add comment
    10|10000 characters needed characters exceeded