2 Replies Latest reply on Oct 24, 2012 6:06 AM by AllenEshleman

    Number to text problem

    AllenEshleman

      Summary

      Number to text problem

      Product

      FileMaker Pro

      Version

      12.0.2

      Operating system version

      Windows XP Professional SP 3

      Description of the issue

      In previous versions the following calculation converted a number to text (on a receipt, for instance).  Now it does not do it.  Can someone tell me what I need to change?  This is for printing a receipt where "Amount of last gift" is the field with the number amount.

      Choose(Int(Mod(Amount of last gift;10^12) / 10^11); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ") &
      If(Int(Mod(Amount of last gift;10^11) / 10^10) = 1;
      Choose(Int(Mod(Amount of last gift;10^10) / 10^9); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
      Choose(Int(Mod(Amount of last gift;10^11) / 10^10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
      Choose(Int(Mod(Amount of last gift;10^10) / 10^9); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &
      Case(Int(Mod(Amount of last gift;10^12)/10^9) and Int(Mod(Amount of last gift;10^9) / 10^3); "Billion, "; Int(Mod(Amount of last gift;10^12)/10^9);"Billion ";"")
      &
      Choose(Int(Mod(Amount of last gift;10^9) / 10^8); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ") &
      If(Int(Mod(Amount of last gift;10^8) / 10^7) = 1;
      Choose(Int(Mod(Amount of last gift;10^7) / 10^6); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
      Choose(Int(Mod(Amount of last gift;10^8) / 10^7); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
      Choose(Int(Mod(Amount of last gift;10^7) / 10^6); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &
      Case(Int(Mod(Amount of last gift;10^9)/10^6) and Int(Mod(Amount of last gift;10^6) / 10^3); "Million, "; Int(Mod(Amount of last gift;10^9)/10^6);"Million ";"")
      &
      Choose(Int(Mod(Amount of last gift;10^6) / 10^5); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ") &
      If(Int(Mod(Amount of last gift;10^5) / 10^4) = 1;
      Choose(Int(Mod(Amount of last gift;10^4) / 10^3); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
      Choose(Int(Mod(Amount of last gift;10^5) / 10^4); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
      Choose(Int(Mod(Amount of last gift;10^4) / 10^3); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &
      Case(Int(Mod(Amount of last gift;10^6)/10^3) and Int(Mod(Amount of last gift;10^3) / 10^0); "Thousand, "; Int(Mod(Amount of last gift;10^6)/10^3);"Thousand ";"")
      &
      Choose(Int(Mod(Amount of last gift;10^3) / 100); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ") &
      If(Int(Mod(Amount of last gift;100) / 10) = 1;
      Choose(Int(Mod(Amount of last gift;10)); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
      Choose(Int(Mod(Amount of last gift;100) / 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
      Choose(Int(Mod(Amount of last gift;10)); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) & Case(Int(Amount of last gift) > 1; "Dollars"; Int(Amount of last gift) = 1; "Dollar"; "")
      &
      If(Mod(Amount of last gift; 1) and Int(Amount of last gift);" and ";"") &
      If(Mod(Int(Amount of last gift*10); 10) = 1;
      Choose(Mod(Int(Amount of last gift*100); 10); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
      Choose(Mod(Int(Amount of last gift*10); 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
      Choose(Mod(Int(Amount of last gift*100); 10); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &
      Case(Mod(Amount of last gift; 1) > .01; "cents"; Mod(Amount of last gift; 1) = .01; "cent";"")

      Expected result

      "50.00" becomes "fifty"

      Actual result

      blank - nothing

        • 1. Re: Number to text problem
          philmodjunk

               How did you use this calculation? In calculation field? A script, an auto-entered calculation?

               I copied your expression into my data viewer and put it inside a let function like this:

               Let ( Amount of last gift = 50.00 ;
               <Above expression was pasted here>
               )

               The result returned was "Fifty Dollars"

               I used FMP 12.02 (haven't yet run the 12.03 updater) on Windows Xp.

          • 2. Re: Number to text problem
            AllenEshleman

                 It did work out then.  I just deleted the field and put it back on the layout and everything worked out fine, then.  Sorry about that, it was a simple fix.

                 Allen