Options

Help--Convert number to word

WarrenLiuWarrenLiu Member Posts: 14
Hi everyone

I am new into navision Programming and I'm requested to write a codeunit to convert number to word urgently, such as convert 1234.56 to one thousand two hundred thirty four dollars and fifty six cents... (maximum upto 900 millions ) Can anyone help? :(
Warren

Comments

  • Options
    RobertMoRobertMo Member Posts: 484
    Take a look at the Payment Journals under Purchase & Payables area.
    Enter a payment and select Payments/Preview Check.
    You should see that your amount was converted into words.

    The functions that are doing that are found in Report 1401 Check.
    Also take a look at the form 404 Check Preview to see how previous report is called.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    vikasvikas Member Posts: 46
    hi..

    if you want to display the "Amount" field (as example) in text format then, creat a recordset of 1401 ("Check" Report), then a text variable of maximum length. With this you must also creat a recordset of "Gen. Journal Line" (so tht currency matches).

    then call this function,

    CheckReport.InitTextVariable;
    CheckReport.FormatNoText(NUMBERTEXT,ROUND(Amount,0.01,'>'),GenJnlLine."Currency Code");

    where CheckReport is recordset for "Check" Report and GenJnlLine is for "Gen. Journal Line" .
  • Options
    WarrenLiuWarrenLiu Member Posts: 14
    Hi

    Thank you all for the valuable infomation. I followed your instructions and finished the report.

    Thanks again.[/quote]
    Warren
Sign In or Register to comment.