3 Replies Latest reply on Mar 10, 2012 3:29 PM by bumper

    How do you get the total amount of the invoice appear in text comprehension

    HelderSantos

      Title

      How do you get the total amount of the invoice appear in text comprehension

      Post

      Hi, i would like to maker appear on my invoice the totally amount like (if total is "283" it appear= two hundred and eighty-three)


      How can it be done, and will it works in "Portugues"?

      any help is fine...

        • 1. Re: How do you get the total amount of the invoice appear in text comprehension
          philmodjunk

          It can be done, but it's not a simple process. You have to isolate each digit and it's power of 10 value in order to substitute the correct text for each digit in the number--at least that's how it's done in English.

          Here's a knowledgebase article on how to do it with English. Perhaps it can serve as a model for how to do it in Portuguese: http://help.filemaker.com/app/answers/detail/a_id/2860/kw/Numbers%20as%20Text

          • 2. Re: How do you get the total amount of the invoice appear in text comprehension
            HelderSantos

            Thanks, it was almost done.  I just still getting this little garbage ";" between the text and a cant find where to delete it.

            But for every one that need it here is 99% working ===== For PORTUGUES LANGUAGE ====== 

             

            Choose(Int(Mod(Rg_Total_TI;10^12) / 10^11); ""; "Cem "; "Duzentos "; "Trezentos "; "Quatrocentos "; "Quinhentos "; "Seiscentos "; "Setecentos "; "Oitocentos "; "Novecentos") &
            If(Int(Mod(Rg_Total_TI;10^11) / 10^10) = 1;
            Choose(Int(Mod(Rg_Total_TI;10^10) / 10^9); "Dez "; "Onze "; "Doze "; "Tereze "; "Quatorze "; "Quinze "; "Dezasseis "; "Dezacete "; "Dezoito "; "Dezanove ");
            Choose(Int(Mod(Rg_Total_TI;10^11) / 10^10); ""; ""; "Vinte "; "Trinta "; "Quarenta "; "Cinquenta "; "Secenta "; "Setenta "; "Oitenta "; "Noventa ") &
            Choose(Int(Mod(Rg_Total_TI;10^10) / 10^9); ""; "Um "; "Dois "; "Treis "; "Quatro "; "Cinco "; "Seis "; "Sete "; "Oito "; "Nove ")) &
            Case(Int(Mod(Rg_Total_TI;10^12)/10^9) and Int(Mod(Rg_Total_TI;10^9) / 10^3); "Billion; "; Int(Mod(Rg_Total_TI;10^12)/10^9);"Bilhão ";"")
            &
            Choose(Int(Mod(Rg_Total_TI;10^9) / 10^8); ""; "Cem "; "Duzentos "; "Trezentos "; "Quatrocentos "; "Quinhentos "; "Seiscentos "; "Setecentos "; "Oitocentos "; "Novecentos") &
            If(Int(Mod(Rg_Total_TI;10^8) / 10^7) = 1;
            Choose(Int(Mod(Rg_Total_TI;10^7) / 10^6); "Dez "; "Onze "; "Doze "; "Tereze "; "Quatorze "; "Quinze "; "Dezasseis "; "Dezacete "; "Dezoito "; "Dezanove ");
            Choose(Int(Mod(Rg_Total_TI;10^8) / 10^7); ""; ""; "Vinte "; "Trinta "; "Quarenta "; "Cinquenta "; "Secenta "; "Setenta "; "Oitenta "; "Noventa ") &
            Choose(Int(Mod(Rg_Total_TI;10^7) / 10^6); ""; "Um "; "Dois "; "Treis "; "Quatro "; "Cinco "; "Seis "; "Sete "; "Oito "; "Nove ")) &
            Case(Int(Mod(Rg_Total_TI;10^9)/10^6) and Int(Mod(Rg_Total_TI;10^6) / 10^3); "Milhão; "; Int(Mod(Rg_Total_TI;10^9)/10^6);"Milhão ";"")
            &
            Choose(Int(Mod(Rg_Total_TI;10^6) / 10^5); ""; "Cem "; "Duzentos "; "Trezentos "; "Quatrocentos "; "Quinhentos "; "Seiscentos "; "Setecentos "; "Oitocentos "; "Novecentos") &
            If(Mod(Rg_Total_TI; 1) and Int(Rg_Total_TI);"e ";"") &
            If(Int(Mod(Rg_Total_TI;10^5) / 10^4) = 1;
            Choose(Int(Mod(Rg_Total_TI;10^4) / 10^3); "Dez "; "Onze "; "Doze "; "Tereze "; "Quatorze "; "Quinze "; "Dezasseis "; "Dezacete "; "Dezoito "; "Dezanove ");
            Choose(Int(Mod(Rg_Total_TI;10^5) / 10^4); ""; ""; "Vinte "; "Trinta "; "Quarenta "; "Cinquenta "; "Secenta "; "Setenta "; "Oitenta "; "Noventa ") &
            If(Mod(Rg_Total_TI; 1) and Int(Rg_Total_TI);"e ";"") &
            Choose(Int(Mod(Rg_Total_TI;10^4) / 10^3); ""; "Um "; "Dois "; "Treis "; "Quatro "; "Cinco "; "Seis "; "Sete "; "Oito "; "Nove ")) &
            Case(Int(Mod(Rg_Total_TI;10^6)/10^3) and Int(Mod(Rg_Total_TI;10^3) / 10^0); "Mil; "; Int(Mod(Rg_Total_TI;10^6)/10^3);"Mil ";"")
            &
            Choose(Int(Mod(Rg_Total_TI;10^3) / 100); ""; "Cem "; "Duzentos "; "Trezentos "; "Quatrocentos "; "Quinhentos "; "Seiscentos "; "Setecentos "; "Oitocentos "; "Novecentos") &
            If(Mod(Rg_Total_TI; 1) and Int(Rg_Total_TI);" e ";"") &
            If(Int(Mod(Rg_Total_TI;100) / 10) = 1;
            Choose(Int(Mod(Rg_Total_TI;10)); "Dez "; "Onze "; "Doze "; "Tereze "; "Quatorze "; "Quinze "; "Dezasseis "; "Dezacete "; "Dezoito "; "Dezanove ");
            Choose(Int(Mod(Rg_Total_TI;100) / 10); ""; "";"Vinte "; "Trinta "; "Quarenta "; "Cinquenta "; "Secenta "; "Setenta "; "Oitenta "; "Noventa ") &
            Choose(Int(Mod(Rg_Total_TI;10)); ""; "Um "; "Dois "; "Treis "; "Quatro "; "Cinco "; "Seis "; "Sete "; "Oito "; "Nove ")) & Case(Int(Rg_Total_TI) > 1; "Kwanzas"; Int(Rg_Total_TI) = 1; "Kwanzas"; "")
            &
            If(Mod(Rg_Total_TI; 1) and Int(Rg_Total_TI);" e ";"") &
            If(Mod(Int(Rg_Total_TI*10); 10) = 1;
            Choose(Mod(Int(Rg_Total_TI*100); 10);"Onze "; "Doze "; "Tereze "; "Quatorze "; "Quinze "; "Dezasseis "; "Dezacete "; "Dezoito "; "Dezanove ");
            Choose(Mod(Int(Rg_Total_TI*10); 10); ""; "";"Vinte "; "Trinta "; "Quarenta "; "Cinquenta "; "Secenta "; "Setenta "; "Oitenta "; "Noventa ") &
            Choose(Mod(Int(Rg_Total_TI*100); 10); ""; "Um "; "Dois "; "Treis "; "Quatro "; "Cinco "; "Seis "; "Sete "; "Oito "; "Nove ")) &
            Case(Mod(Rg_Total_TI; 1) < 1; "centimo"; Mod(Rg_Total_TI; 1) < 1; "centimo";"")

            • 3. Re: How do you get the total amount of the invoice appear in text comprehension
              bumper

              in this line:

               

              Case(Int(Mod(Rg_Total_TI;10^6)/10^3) and Int(Mod(Rg_Total_TI;10^3) / 10^0); "Mil; "; Int(Mod(Rg_Total_TI;10^6)/10^3);"Mil ";"")

               

              the first Mil has a semicolon that is included as text, delete that and it should start working correctly.