--> Finance Intern with Problem!

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default --> Finance Intern with Problem!

    If anyone could help with this today, I would greatly appreciate it .

    Here is my attempt:

    function Calculate()
    {
    theForm = document.forms["calculator"];
    with(Math)
    {
    P = theForm.contract.value;
    I = theForm.rate.value;
    n = theForm.term.value;
    t = theForm.type.value;
    if t = 1;
    v = (P * I/1200)/(1 - pow(1+I/1200,-n));
    // two decimal places
    theForm.payment.value = round(100 * v)/100;
    else if t=2;
    P2 = P * (1+pow(I/12),3);
    v = (P2 * I/1200)/(1-pow(1+I/1200,-n));
    // two decimal places
    theForm.payment.value = round(100 * v)/100;
    else if t = 3;
    P3 = P * (1+pow(I/12),6);
    v = (P3 * I/1200)/(1-pow(1+I/1200,-n));
    // two decimal places
    theForm.payment.value = round(100 * v)/100;
    else if t = 4;
    P3 = P * (1+pow(I/12),12);
    v = (P3 * I/1200)/(1-pow(1+I/1200,-n));
    // two decimal places
    theForm.payment.value = round(100 * v)/100;

    }
    return false;
    }
    </script>
    [/B] </font>

    Yeah, it doesn't work. :) I know it works without the conditional
    statements, so the problem lies with the conditional statements. How close am
    I?

    Brad L. Hotz

    FinanceGuy Guest

  2. Similar Questions and Discussions

    1. Yahoo Finance Stock Chart
      Hi, looks like Yahoo Finance started to use flash to generate the stock chart. Can anyone give me some clue how those chart was generated? ...
    2. Flash player no audio at finance.yahoo.com?
      I hope someone can help me because it's driving me crazy. Macromedia flash player appears to have no sound when playing videos from...
    3. [ANNOUNCE] Finance::Bank::HDFC version 0.12
      Hi, I would like to announce the availability of Perl module Finance::Bank::HDFC version 0.12 on the CPAN. From the docs: NAME...
    4. [ANNOUNCE] Finance::Bank::HDFC version 0.01
      Hi, I would like to announce the availability of Perl module Finance::Bank::HDFC version 0.01 on the CPAN. From the docs: NAME...
    5. Request for Comments - Finance::Calc::Performance
      Please critique this potential new module with respect to namespace choice, naming conventions and general functionality. The POD is rather big so...
  3. #2

    Default Re: --> Finance Intern with Problem!

    The format for the if statement in javascript is:

    if (condition) {
    statement block
    }
    elseif (condition) {
    statement block
    }

    So ,maybe this is what you meant:
    if (t = 1) {
    v = (P * I/1200)/(1 - pow(1+I/1200,-n));
    // two decimal places
    document.theForm.payment.value = round(100 * v)/100;}

    etcetera


    delaneypub Guest

  4. #3

    Default Re: --> Finance Intern with Problem!

    Thanks for the javascript tip.

    I put that into my code, and it didn't work.

    Brad
    FinanceGuy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139