Search code examples
c#mathfinance

how do I use Financial.NPV() function in c#


I have to use NPV function for Financial calculation. I did some researches but I was confused about how to add it into my c# project.

people say that; Just add Financial.dll to the references in your project. The functions are provided as static methods on a Financial class in the System.Numerics namespace

I added System.Numerics namespace but I couldnt reach to NPV function. Where can I find the Financial.dll file?

Thanks


Solution

  • Access it just like any other classes containing functions:

    double npvResult = Financial.Npv(rate, flows);
    

    (Pulled from here)