Results 1 to 6 of 6

Thread: Last question of the day...

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Last question of the day...

    Visual Basic has some built in financial calculations.
    The following is how I would code it in VB. Any thoughts on C# equivalent? It is computing a payment amount for a loan.

    Payment = Pmt(APR2 / 12, TotPmts, -PVal, FVal, PayType2);
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  2. #2
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Last question of the day...

    Hi again,
    There isn't an equivalent function in C#. However, you can add a reference to the Microsoft.VisualBasic.DLL in your C# project and use its functions. I don't imagine that this is often a great idea, but regarding the financial functions, there are some good ones in VB, so I've used them like this before.

    1) Add a reference to Microsoft.VisualBasic DLL in your project.
    2) Add
    Code:
    using Microsoft.VisualBasic;
    to the top of the class where you want to use your financial functions.
    3) Use your Pmt function as so:
    Code:
    Financial.Pmt(Rate, NPer, PV, FV, Due);

  3. #3

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Last question of the day...

    I will give it a shot and report back.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  4. #4

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Last question of the day...

    That didn't work. Looks like I need to get my accountign book out and do it from scratch.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  5. #5
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Last question of the day...

    It works. What is the problem?
    Attached Images Attached Images  

  6. #6

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Last question of the day...

    I got to that point. I needed to add Math.abs(Financial.Pmt...
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

Posting Permissions

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



Click Here to Expand Forum to Full Width