Appify.HumanReadableCalculationSteps 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Appify.HumanReadableCalculationSteps --version 1.1.1
                    
NuGet\Install-Package Appify.HumanReadableCalculationSteps -Version 1.1.1
                    
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="Appify.HumanReadableCalculationSteps" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Appify.HumanReadableCalculationSteps" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Appify.HumanReadableCalculationSteps" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Appify.HumanReadableCalculationSteps --version 1.1.1
                    
#r "nuget: Appify.HumanReadableCalculationSteps, 1.1.1"
                    
#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.
#addin nuget:?package=Appify.HumanReadableCalculationSteps&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Appify.HumanReadableCalculationSteps&version=1.1.1
                    
Install as a Cake Tool

Human Readable Calculation Steps .NET

Useful for auditing, displaying calculation steps to an end-user.

Usage

This example demonstrates how the library automatically handles operator precedence, ensuring that calculations are both accurate and easy to understand. When you combine addition or subtraction with multiplication or division, the library automatically adds parentheses to the output to make the order of operations explicit.

Operator Precedence

var a = 2m.As("a");
var b = 3m.As("b");
var c = 4m.As("c");

// The expression (a + b) * c is evaluated as (2 + 3) * 4 = 20
var result = (a + b) * c;

The result.Caption property will contain the string "(a[2] + b[3]) × c[4]", showing that addition is performed before multiplication.

Complex scenarios

var basePrice = 200m.As("BasePrice");
var discountRate = 0.15m.As("DiscountRate");
var taxRate = 0.08m.As("TaxRate");

var discount = (basePrice * discountRate).As("Discount");
var discountedPrice = (basePrice - discount).As("DiscountedPrice");
var tax = (discountedPrice * taxRate).As("Tax");
var finalTotal = (discountedPrice + tax).As("FinalTotal");

The finalTotal.FinalCalculationSteps property will produce the following output:

Discount = BasePrice[200] * DiscountRate[0.15] = 30

DiscountedPrice = BasePrice[200] - Discount[30] = 170

Tax = DiscountedPrice[170] * TaxRate[0.08] = 13.6

FinalTotal = DiscountedPrice[170] + Tax[13.6] = 183.6
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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.3.3 42 6/30/2025
1.3.2 40 6/30/2025
1.3.1 40 6/30/2025
1.3.0 42 6/30/2025
1.2.1 45 6/30/2025
1.2.0 45 6/30/2025
1.1.1 42 6/29/2025
1.1.0 43 6/29/2025
1.0.4 45 6/29/2025
1.0.3 43 6/29/2025
1.0.2 41 6/28/2025
1.0.1 45 6/27/2025
1.0.0 45 6/27/2025