FinancialMath 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FinancialMath --version 1.0.0                
NuGet\Install-Package FinancialMath -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FinancialMath" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FinancialMath --version 1.0.0                
#r "nuget: FinancialMath, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FinancialMath as a Cake Addin
#addin nuget:?package=FinancialMath&version=1.0.0

// Install FinancialMath as a Cake Tool
#tool nuget:?package=FinancialMath&version=1.0.0                

FinancialMath

Written to be used in a .NET Core application, this library is designed to provide a set of financial calculations that are commonly used in the financial industry.

Highly customizable and extendable this library allows you to inject your own implementations of the various calculators to allow for custom behavior.

Features

  • Amortization
    • Schedule
    • Payment

Usage

Quick and easy method to calculate an amortization schedule:
// using FinancialMath;

// Arrange
LoanTerms loanTerms = LoanTerms.Create(
    loanAmount: 100000m,    // Starting Principal of $100,000
    interestRate: .05m,     // 5% annual interest rate
    loanTermMonths: 360,    // 30 years (360 months)
    roundingPrecision: 2    // Round results (payments and interest each month) to the nearest cent IE 2 decimal places.
);

IAmortizationSchedule result = AmortizationScheduleProvider.GetAmortizationSchedule(loanTerms);

More advanced usage, allowing for custom implementations through dependency injection:
// using FinancialMath;

// Amortization Schedule Example
LoanTerms loanTerms = LoanTerms.Create(
    loanAmount: 152000m,     // Starting Principal of $152,000
    interestRate: .03375m,    // 3.375% annual interest rate
    loanTermMonths: 180,     // 15 years (180 months)
    roundingPrecision: 2,    // Round to the nearest cent
    paymentRoundingMethod: MidpointRounding.ToPositiveInfinity
);

// Setup Dependencies To Inject
AmortizationSchedule amortizationSchedule = new();
AmortizationScheduleItem amortizationScheduleItem = new();
AmortizationScheduleItemCalculator amortizationScheduleItemCalculator = new(amortizationScheduleItem);
AmortizationPaymentCalculator amortizationPaymentCalculator = new();

// Get our amortization schedule:
AmortizationScheduleCalculator amortizationScheduleCalculator = new(amortizationSchedule, amortizationScheduleItemCalculator, amortizationPaymentCalculator);

AmortizationSchedule result = (AmortizationSchedule)amortizationScheduleCalculator.GetAmortizationSchedule(loanTerms);

Notes:

Interest rates will always be in decimal form.

  • For example, 3.375% would be represented as .03375.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 83 10/29/2024
1.0.0 130 10/18/2024

Initial Release