Finance.Tenor 2.1.0

The best and fast implementation of the finance tenor.

Install-Package Finance.Tenor -Version 2.1.0
dotnet add package Finance.Tenor --version 2.1.0
<PackageReference Include="Finance.Tenor" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Finance.Tenor --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Finance.Tenor

  • The best and fast implementation of the finance tenor.
  • Low GC Gen0 memory pressure when parsing millions tenors.
Version 2.1.0
  • Add support comparison operators "<" ">" "==" "!=" ">=" "<=".
  • Supported 1y == 12m
  • Supported 1m == 30d
  • Supported 1w == 7d
Version 2.0.0
  • NetStandard 2.0
  • Net 4.7.2
  • Net 4.6.2
  • Net 4.5.2

Nuget.org

Tenor

Tenor in finance can have multiple usages, but it most commonly refers to the amount of time left for the repayment
of a loan or until a financial contract expires. It is most commonly used for non - standardized contracts, such as foreign
exchange and interest rate swaps, while the term "maturity" is usually used to express the same concept for government bonds and corporate bonds.
Tenor can also refer to the payment frequency on an interest rate swap.

The tenor string can be in the following formats:

  • Xd = X day;
  • Yw = Y week
  • Ym = Z month
  • Gy = G year
  • or any combinations of above

Examples:

  • 1w6d
  • 1y6m
  • 1w1d
  • 1y6m2d5w

Code usage examples:

    // Create  tenor "1y1m1w1d"
    Tenor tenor = new Tenor(1, 1, 1, 1);
    // Parse  tenor 
    string tenor = "1m1w1d1y";
    Tenor res =Tenor.Parse(tenor);
    // Compare  tenors 
    string tenor1w = "1w";
    string tenor7d = "7d";
    Tenor t1w =Tenor.Parse(tenor1w);
    Tenor t7d =Tenor.Parse(tenor7d);

    if( t1w == 7d)
    {
    
    }

Finance.Tenor

  • The best and fast implementation of the finance tenor.
  • Low GC Gen0 memory pressure when parsing millions tenors.
Version 2.1.0
  • Add support comparison operators "<" ">" "==" "!=" ">=" "<=".
  • Supported 1y == 12m
  • Supported 1m == 30d
  • Supported 1w == 7d
Version 2.0.0
  • NetStandard 2.0
  • Net 4.7.2
  • Net 4.6.2
  • Net 4.5.2

Nuget.org

Tenor

Tenor in finance can have multiple usages, but it most commonly refers to the amount of time left for the repayment
of a loan or until a financial contract expires. It is most commonly used for non - standardized contracts, such as foreign
exchange and interest rate swaps, while the term "maturity" is usually used to express the same concept for government bonds and corporate bonds.
Tenor can also refer to the payment frequency on an interest rate swap.

The tenor string can be in the following formats:

  • Xd = X day;
  • Yw = Y week
  • Ym = Z month
  • Gy = G year
  • or any combinations of above

Examples:

  • 1w6d
  • 1y6m
  • 1w1d
  • 1y6m2d5w

Code usage examples:

    // Create  tenor "1y1m1w1d"
    Tenor tenor = new Tenor(1, 1, 1, 1);
    // Parse  tenor 
    string tenor = "1m1w1d1y";
    Tenor res =Tenor.Parse(tenor);
    // Compare  tenors 
    string tenor1w = "1w";
    string tenor7d = "7d";
    Tenor t1w =Tenor.Parse(tenor1w);
    Tenor t7d =Tenor.Parse(tenor7d);

    if( t1w == 7d)
    {
    
    }

Release Notes

Low temporary memory usage/allocations, i.e. Low GC/CLR Gen0 memory pressure.
     Ultra fast parsing.
     Multi-target frameworks.
     Supports comparison operations.

  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.1.0 110 2/24/2019
2.0.0 102 2/20/2019