This extension facilitates the calculation of both simple interest and compound interest.
Here are some examples of how to use the extension:
decimal principal = 100;
decimal interestRate = 0.004m;
int period = 7;
// Calculate simple interest
decimal simpleInterest = principal.CalculateSimpleInterest(interestRate, period);
Console.WriteLine($"Simple interest: {simpleInterest}");
// Calculate compound interest
decimal compoundInterest = principal.CalculateCompoundInterest(interestRate, period);
Console.WriteLine($"Compound interest: {compoundInterest}");
To install the package via NuGet, you can use the following command:
dotnet add package InterestExtensions
You can also visit the NuGet package page for more information and to download the package.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.