Discussions

 View Only
Expand all | Collapse all

How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

  • 1.  How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

     
    Posted 02-25-2015 17:21

    I could do it with this formula!


    var text numt = ToText(Floor([Number]));

    var text cents = If(Contains(ToText([Number]), "."), Left(Right(ToText([Number]) & "00", "."), 2),"");

    var text teensnum = List(" ",

    Case(Floor(ToNumber(Right($numt,2))/10),

    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),

    Case(ToNumber(Right($numt,1)),

    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));


    var text teens =

    If($teensnum<>"" and [Number]>99, "and ", "") &

    Case($teensnum,

    "Ten One", "Eleven", "Ten Two", "Twelve", "Ten Three", "Thirteen", "Ten Four", "Fourteen", "Ten Five", "Fifteen", "Ten Six", "Sixteen", "Ten Seven", "Seventeen", "Ten Eight", "Eighteen", "Ten Nine", "Nineteen", $teensnum);


    var text teensnumcents =List(" ",

    Case(Left($cents,1),

    "1", "Ten", "2", "Twenty", "3", "Thirty", "4", "Forty", "5", "Fifty", "6", "Sixty", "7", "Seventy", "8", "Eighty", "9", "Ninety", "0", ""),

    Case(Right($cents,1),

    "1", "One", "2", "Two", "3", "Three", "4", "Four", "5", "Five", "6", "Six", "7", "Seven", "8", "Eight", "9", "Nine", "0", "")

    );



    var text teenscents =

    If($teensnumcents<>"", " and ", "") &

    Case($teensnumcents,

    "Ten One", "Eleven", "Ten Two", "Twelve", "Ten Three", "Thirteen", "Ten Four", "Fourteen", "Ten Five", "Fifteen", "Ten Six", "Sixteen", "Ten Seven", "Seventeen", "Ten Eight", "Eighteen", "Ten Nine", "Nineteen", $teensnumcents)& If($teensnumcents<>"", " Cents", "");




    List(" ",

    If([Number]>=1000000,

    Case(Floor([Number]/1000000),

    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine") & " Million","") & If(Mod([Number],1000000)>0 and [Number]>1000000, ",", ""),

    If([Number]>=100000,

    Case(Floor(ToNumber(Right($numt,6))/100000),

    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine") & " Hundred","") & If(Mod([Number],100000)>0 and [Number]>100000, " and", "") ,

    If([Number]>=10000,

    Case(Floor(ToNumber(Right($numt,5))/10000),

    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),""),

    If([Number]>=1000,

    Case(Floor(ToNumber(Right($numt,4))/1000),

    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, "") & " Thousand","") & If(Mod([Number],1000)>0 and [Number]>1000, ",", ""),

    If([Number]>=100,

    Case(Floor(ToNumber(Right($numt,3))/100),

    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, ""),""),

    $teens)


    & " Dollars" & $teenscents




  • 2.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 02-25-2015 17:37
    Thx for sharing.  I will save that for my next Cheque writing app.


  • 3.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 04-02-2015 15:06
    As usual ... you are da man!


  • 4.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 08-30-2016 18:35
    Hi Sam, I am using the above formula but i noticed one issue if we give single digit number 2 then its returning "and two dollors" :(
    Example - Number = 11600 then formula is giving value "Ten One Thousand, Six hundread dollars" ideally it should say "Eleven thousand and Six hundread dollars" ? i am trying to fix it but would be great if you can tell me which variable is causing this issue?

    It would be great help if you can provide us the upgraded formula if you have. or atleast can guide me where to make the changes to achieve the goal :)


  • 5.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 04-01-2019 19:45
    I noticed this as well, did you get any update on this?


  • 6.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 04-24-2019 19:49
    I made some modifications to this calculation so that it could update the teens. I am SURE there are better ways to do this, but I needed it quickly and I didn't want to waste any time cleaning it up. Posting here in case someone else needs it. 

    var number Value = Round([xxTHENUMERICFIELDxx],0.01);
    var text Hundreds=Right(ToText(Int($Value)),3);
    var text Thousands = If($Value>=1000,ToText(Int($Value/1000)));
    var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));

    var text numt = ToText(Floor([xxTHENUMERICFIELDxx]));

    var text cents = If(Contains(ToText([xxTHENUMERICFIELDxx]), "."), Left(Right(ToText([xxTHENUMERICFIELDxx]) & "00", "."), 2),"");
    var text centDecimals = If(Contains(ToText([xxTHENUMERICFIELDxx]), "."),Right(ToText(Int($value * 100)),2));

    var text teensnumcents = If($centDecimals<>"", " and " & List("/",
    $centDecimals,"100")," and No/100") & " Dollars" ;

    var text firstNum = Case(Floor(ToNumber(Right($numt,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, "");
    var text secondNum = Case(ToNumber(Right($numt,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, "");
    var text thirdNum = Case(Floor(ToNumber(Right($numt,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");
    var text firstThouNum = If($Thousands<>"",Case(Floor(ToNumber(Right($Thousands,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondThouNum = If($Thousands<>"",Case(ToNumber(Right($Thousands,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdThouNum = Case(Floor(ToNumber(Right($Thousands,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");
    var text firstMilNum = If($Millions<>"",Case(Floor(ToNumber(Right($Millions,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondMilNum = If($Millions<>"",Case(ToNumber(Right($Millions,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdMilNum = Case(Floor(ToNumber(Right($Millions,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");

    var text tensNum = List("-", $firstNum, $secondNum);
    var text thouNum = List("-", $firstThouNum, $secondThouNum);
    var text millNum = List("-", $firstMilNum, $secondMilNum);

    var text teensCon = If(Contains($tensNum,"ten-")=true,Case($tensNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $tensNum),$tensNum);

    var text thouCon = If(Contains($thouNum,"ten-")=true,Case($thouNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $thouNum),$thouNum);

    var text millCon = If(Contains($millNum,"ten-")=true,Case($millNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $millNum),$millNum);

    var text teens = $teensCon;
    var text Thouteens = If($thouNum<>"" and [xxTHENUMERICFIELDxx]>999, " ", "") & $thouCon;
    var text Milteens = If($millNum<>"" and [xxTHENUMERICFIELDxx]>999999, " ", "") & $millCon;

    var text hundredsNum = $thirdNum &" "& $teens;
    var text hundredsThouNum = $thirdThouNum &" "& $thouCon;
    var text hundredsMillNum = $thirdMilNum &" "& $millCon;

    var text finalHund = $hundredsNum; 
    var text finalThou = $hundredsThouNum & " Thousand";
    var text finalMill = $hundredsMillNum & " Million";

    //var text finalThouOne = if(Contains($finalThou,"Ten-",$Thouteens,$finalThou));


    If($millNum<>"" and [xxTHENUMERICFIELDxx]>999999, $finalMill, "")&" "&
    If($thouNum<>"" and [xxTHENUMERICFIELDxx]>999,$finalThou, "")&" "&
    If($tensNum<>"" and [xxTHENUMERICFIELDxx]>99, $finalHund, $teens) & 
    if(nz([xxTHENUMERICFIELDxx])<>0,$teensnumcents,"")


  • 7.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 04-24-2019 19:53
    Thank you for posting!


  • 8.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 04-24-2019 20:02
    no worries, Sam did all the heavy lifting for this!


  • 9.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 15:33
    quick head's up. My coworkers were able to break this, it does not seem to work if the field being calculated on has more than 10 digits. So if you have a number with a decimal point, it will begin rounding or cutting off the last digit. You can play around to find a good solution, I decided to create two formula fields, one for the decimal, and one for the whole number and then combine the text in a third formula field. good luck!


  • 10.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 15:43
    We would love to see your code!


  • 11.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 15:45
    For the Whole Number: 
    var number OriginalVal = [xxTHENUMERICFIELDxx];
    var number Value = Round($OriginalValue,0.01);
    var text Hundreds=Right(ToText(Int($Value)),3);
    var text Thousands = If($Value>=1000,ToText(Int($Value/1000)));
    var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));
    var text numt = ToText(Floor($OriginalValue));

    var text firstNum = Case(Floor(ToNumber(Right($numt,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, "");
    var text secondNum = Case(ToNumber(Right($numt,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, "");
    var text thirdNum = Case(Floor(ToNumber(Right($numt,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");
    var text firstThouNum = If($Thousands<>"",Case(Floor(ToNumber(Right($Thousands,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondThouNum = If($Thousands<>"",Case(ToNumber(Right($Thousands,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdThouNum = If($Thousands<>"",Case(Floor(ToNumber(Right($Thousands,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, ""));
    var text firstMilNum = If($Millions<>"",Case(Floor(ToNumber(Right($Millions,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondMilNum = If($Millions<>"",Case(ToNumber(Right($Millions,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdMilNum = Case(Floor(ToNumber(Right($Millions,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");

    var text tensNum = List("-", $firstNum, $secondNum);
    var text thouNum = List("-", $firstThouNum, $secondThouNum);
    var text millNum = List("-", $firstMilNum, $secondMilNum);


    var text teensCon = If(Contains($tensNum,"ten-")=true,Case($tensNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $tensNum),$tensNum);

    var text thouCon = If(Contains($thouNum,"ten-")=true,Case($thouNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $thouNum),$thouNum);

    var text millCon = If(Contains($millNum,"ten-")=true,Case($millNum,
    "Ten-One", "Eleven", 
    "Ten-Two", "Twelve", 
    "Ten-Three", "Thirteen", 
    "Ten-Four", "Fourteen", 
    "Ten-Five", "Fifteen", 
    "Ten-Six", "Sixteen", 
    "Ten-Seven", "Seventeen", 
    "Ten-Eight", "Eighteen", 
    "Ten-Nine", "Nineteen", $millNum),$millNum);

    var text hundredsNum = $thirdNum & If($teensCon<>""," "& $teensCon,"");
    var text hundredsThouNum = $thirdThouNum & If($thouCon<>""," " & $thouCon,"");
    var text hundredsMillNum = $thirdMilNum & If($millCon<>"", " "& $millCon,"");

    var text finalHund = Trim($hundredsNum); 
    var text finalThou = Trim($hundredsThouNum & " Thousand");
    var text finalMill = Trim($hundredsMillNum & " Million");

    var text finalNumber = if(Floor($OriginalValue)<=0,"Zero",
    If($hundredsMillNum <> " " and $OriginalValue>=1000000, $finalMill, "")&
    If($hundredsThouNum <> "" and $OriginalValue>=1000," "& $finalThou, "")&
    If(ToNumber($Hundreds)<>0 and $OriginalValue>=99," "& $finalHund, $teensCon));

    Trim($finalNumber)


  • 12.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 15:50
    The cents can be done the same way, with the formula only reading up to the tenths place instead of up to millions. In my case, I needed only the digits to display in the following matter: xxx and 12/100 dollars. Therefore, I only had to grab the two digits and verify it didn't attempt to round them etc. 

    var number Split = Frac([xxTHENUMERICFIELDxx]);
    ToNumber(Left(Right(ToText($Split)&"0","."),2))

    This formula reliably grabs the single or double digit after the decimal point, and keeps them exactly as is. I am adding a calculation that also adds a 0 after a digit to protect against user error. Ex. $100.2 should behave like $100.20. By adding a 0 after every number that is grabbed, I can confidently pull back a two digit number. whew. The final formula just adds [formula field 1] & "." & [formula field 2]. 
    I am at Empower, so if anyone wants to chat, find me on the app!


  • 13.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 05-20-2020 09:44
    I am so appreciative I didn't have to do this!
    a few changes.
    removed dashes between values, added "Dollar"/"Dollars" and cents at the end. Below is all three fields needed with their names underlined. Look for [<currency field>] and replace it with the field in your table.

    _____________[currencyToWords] type text/rich text formula

    var number OriginalValue = [<currency field>];
    var number Value = Round($OriginalValue,0.01);
    var text Hundreds=Right(ToText(Int($Value)),3);
    var text Thousands = If($Value>=1000,ToText(Int($Value/1000)));
    var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));
    var text numt = ToText(Floor($OriginalValue));

    var text firstNum = Case(Floor(ToNumber(Right($numt,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, "");
    var text secondNum = Case(ToNumber(Right($numt,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, "");
    var text thirdNum = Case(Floor(ToNumber(Right($numt,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");
    var text firstThouNum = If($Thousands<>"",Case(Floor(ToNumber(Right($Thousands,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondThouNum = If($Thousands<>"",Case(ToNumber(Right($Thousands,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdThouNum = If($Thousands<>"",Case(Floor(ToNumber(Right($Thousands,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, ""));
    var text firstMilNum = If($Millions<>"",Case(Floor(ToNumber(Right($Millions,2))/10),
    1, "Ten", 2, "Twenty", 3, "Thirty", 4, "Forty", 5, "Fifty", 6, "Sixty", 7, "Seventy", 8, "Eighty", 9, "Ninety", 0, ""),"");
    var text secondMilNum = If($Millions<>"",Case(ToNumber(Right($Millions,1)),
    1, "One", 2, "Two", 3, "Three", 4, "Four", 5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", 0, ""));
    var text thirdMilNum = Case(Floor(ToNumber(Right($Millions,3))/100),
    1, "One Hundred", 2, "Two Hundred", 3, "Three Hundred", 4, "Four Hundred", 5, "Five Hundred", 6, "Six Hundred", 7, "Seven Hundred", 8, "Eight Hundred", 9, "Nine Hundred", 0, "");

    var text tensNum = List(" ", $firstNum, $secondNum);
    var text thouNum = List(" ", $firstThouNum, $secondThouNum);
    var text millNum = List(" ", $firstMilNum, $secondMilNum);


    var text teensCon = If(Contains($tensNum,"ten ")=true,Case($tensNum,
    "Ten One", "Eleven",
    "Ten Two", "Twelve",
    "Ten Three", "Thirteen",
    "Ten Four", "Fourteen",
    "Ten Five", "Fifteen",
    "Ten Six", "Sixteen",
    "Ten Seven", "Seventeen",
    "Ten Eight", "Eighteen",
    "Ten Nine", "Nineteen", $tensNum),$tensNum);

    var text thouCon = If(Contains($thouNum,"ten ")=true,Case($thouNum,
    "Ten One", "Eleven",
    "Ten Two", "Twelve",
    "Ten Three", "Thirteen",
    "Ten Four", "Fourteen",
    "Ten Five", "Fifteen",
    "Ten Six", "Sixteen",
    "Ten Seven", "Seventeen",
    "Ten Eight", "Eighteen",
    "Ten Nine", "Nineteen", $thouNum),$thouNum);

    var text millCon = If(Contains($millNum,"ten ")=true,Case($millNum,
    "Ten One", "Eleven",
    "Ten Two", "Twelve",
    "Ten Three", "Thirteen",
    "Ten Four", "Fourteen",
    "Ten Five", "Fifteen",
    "Ten Six", "Sixteen",
    "Ten Seven", "Seventeen",
    "Ten Eight", "Eighteen",
    "Ten Nine", "Nineteen", $millNum),$millNum);

    var text hundredsNum = $thirdNum & If($teensCon<>""," "& $teensCon,"");
    var text hundredsThouNum = $thirdThouNum & If($thouCon<>""," " & $thouCon,"");
    var text hundredsMillNum = $thirdMilNum & If($millCon<>"", " "& $millCon,"");

    var text finalHund = Trim($hundredsNum);
    var text finalThou = Trim($hundredsThouNum & " Thousand");
    var text finalMill = Trim($hundredsMillNum & " Million");

    var text finalNumber = If(Floor($OriginalValue)<=0,"Zero",
    If($hundredsMillNum <> " " and $OriginalValue>=1000000, $finalMill, "")&
    If($hundredsThouNum <> "" and $OriginalValue>=1000," "& $finalThou, "")&
    If(ToNumber($Hundreds)<>0 and $OriginalValue>=99," "& $finalHund, $teensCon));

    Trim($finalNumber & If($numt="1", " Dollar"," Dollars") & [currencyCents])

    _________________________[currencyCents] type text/rich text formula

    var text cents = If(Contains(ToText([currencySplitCents]), ""), Left(Right(ToText([currencySplitCents]) & "00", "."), 2),"");

    var text teenNumCents = List(" ",
    Case(Left($cents,1), "1", "Ten", "2", "Twenty", "3", "Thirty", "4", "Forty", "5", "Fifty", "6", "Sixty", "7", "Seventy", "8", "Eighty", "9", "Ninety", "0", ""),
    Case(Right($cents,1), "1", "One", "2", "Two", "3", "Three", "4", "Four", "5", "Five", "6", "Six", "7", "Seven", "8", "Eight", "9", "Nine", "0", ""));

    If($teenNumCents<>"", " and ", "") & //if teensnum not "" add a space
    Case($teenNumCents,"Ten One", "Eleven", "Ten Two", "Twelve", "Ten Three", "Thirteen", "Ten Four", "Fourteen", "Ten Five", "Fifteen", "Ten Six", "Sixteen", "Ten Seven", "Seventeen", "Ten Eight", "Eighteen", "Ten Nine", "Nineteen", $teenNumCents)& If($teenNumCents<>"", " Cents", "")

    _________________[currencySplitCents] numeric formula

    var number cents = Frac([<currency field>]);
    ToNumber(Left(Right(ToText($cents)&"0","."),2))


    ------------------------------
    Jim Harrison
    ------------------------------



  • 14.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 15:55
    Thx for posting. I�m here @ Empower too. (Mark Shnier)


  • 15.  RE: How can I get the text of a number in the way one would speak it? For example $100.00 = One Hundred Dollars

    Posted 06-12-2019 19:02
    just messaged you on the empower app!