Releases: AppifySheets/human-readable-calculation-steps
Release list
Release 1.4.0
v1.4.0 - Line endings, equality contract alignment, version bump - FinalCalculationSteps now emits platform-stable CRLF line endings. - Equals/GetHashCode are value-based only, agreeing with operator == and CompareTo. - 21 new tests (equality contract + edge cases).
v1.3.3 - Fix NuGet Package Icon Visibility
What's Changed
NuGet Package Icon Fix
- Fixed NuGet package icon visibility by placing icon in package root
- Icon now properly displays in NuGet.org package listings
- Improved package discoverability with visible branding
Previous Enhancements (from v1.3.2)
- Enhanced multiline formatting for long expressions in
FinalCalculationSteps - Fixed arithmetic expressions to use proper newline formatting
- Repository cleanup and build configuration fixes
Technical Details
- Corrected
PackageIconreference to point to package root (icon.png) - Updated
PackagePathto place icon at package root level - Physical icon file remains in
assets/icon.pngin repository - All GitHub Actions workflows now pass successfully
Impact
- Better package visibility on NuGet.org
- Professional appearance with proper icon display
- Improved user experience when discovering the package
Merged via PR: #41
Full Changelog: v1.3.2...v1.3.3
v1.3.2 - Enhanced Multiline Formatting and Arithmetic Expression Fixes
What's Changed
Enhanced Multiline Formatting
- Added comprehensive multiline formatting for long expressions in
FinalCalculationSteps - Improved readability of complex arithmetic expressions with proper line breaks and indentation
Arithmetic Expression Formatting Fixes
- Fixed arithmetic expressions to use
\n= resultformat instead of= resultfor better visual separation - Added pattern matching to detect simple arithmetic and complex expressions with parentheses
- Fixed operator spacing when followed by parentheses
- Removed all trailing spaces from formatted output lines
Repository Cleanup & Build Fixes
- Removed remaining debug files and temporary test projects
- Fixed NuGet package icon path configuration to resolve GitHub Actions build failures
- Corrected PackageIcon reference to properly include assets/icon.png in published packages
Test Coverage
- All 169 tests now pass
- Added comprehensive test coverage for multiline formatting scenarios
- Fixed test expectations to match improved formatting behavior
Technical Improvements
- Enhanced expression parsing and formatting logic
- Better handling of operator precedence in multiline displays
- Improved pattern recognition for various expression types
- Resolved NuGet packaging issues for successful automated publishing
Merged via PRs: #38, #39, #40
Full Changelog: v1.3.1...v1.3.2
v1.3.1: Fix Sum operations parentheses and wrapped value definitions
๐ What's New in v1.3.1
๐ง Bug Fixes
Sum Operations Parentheses
- Fixed missing parentheses for Sum operations when used in multiplication/division contexts
- Sum operations now properly wrapped with parentheses for mathematical clarity
- Example:
(Sum(items)) ร multiplierinstead ofSum(items) ร multiplier
Wrapped Value Definitions in FinalCalculationSteps
- Enhanced calculation step display to include wrapped value definitions when used in complex expressions
- Intelligent complexity detection determines when to show multi-line format
- Wrapped values now properly show their definitions in calculation steps
๐งช Test Results
- Fixed 7 originally failing tests related to missing parentheses and definitions
- Resolved 2 additional side-effect failures from over-aggressive formatting
- All 168 tests now passing โ
๐ง Technical Changes
Core Improvements
- FormatOperand method: Enhanced Sum operation detection and parentheses logic
- FinalCalculationSteps property: Improved wrapped value definition inclusion
- CountOperators helper: New method for expression complexity analysis
Code Examples
Sum Parentheses Detection:
// Only add parentheses for actual Sum operations, not multiplications containing sums
var isTopLevelSum = operand._caption.StartsWith("Sum(") ||
(operand._caption.Contains(" + ") &&
\!operand._caption.Contains(" ร ") &&
\!operand._caption.Contains(" รท "));Wrapped Value Multi-line Logic:
// Only show multi-line format for multiplication expressions with wrapped values
var operatorCount = CountOperators(_caption);
var isSimpleMultiplication = operatorCount == 1 && _caption.Contains(" ร ") &&
_caption.Contains(wrappedName + "[");
shouldShowMultiLine = hasComplexDefinition && isSimpleMultiplication;๐ Files Modified
HumanReadableCalculationSteps/ValueWithCaption.cs- Core formatting logic- Test files - Updated expectations for improved formatting behavior
๐ Related
๐ค Contributors
This release includes improvements to mathematical notation accuracy and calculation step visibility, ensuring better user experience when working with complex expressions.
Full Changelog: v1.3.0...v1.3.1
v1.3.0 - Enhanced Caption Formatting
๐ What's New in v1.3.0
Enhanced Caption Formatting
- Enhanced Caption property now uses superior FinalCalculationSteps formatting logic for named values
- Detailed multi-line formatting for complex calculations showing complete calculation chains
- Maintained backward compatibility - simple formatting preserved for non-named values
Example Output Format
The enhanced formatting now produces detailed calculation steps like:
DiscountedPrice = แกแแแแแ แคแแกแ[100] - แคแแกแแแแแแแ[15] = 85
SomeValueResult = DiscountedPrice[85] ร SomeValue[55.23] = 4,694.8
TaxValue = แกแแแแแ แคแแกแ[100] ร แแฆแ[0.18] = 18
FinalValue =
SomeValueResult[4,694.8]
ร
( DiscountedPrice[85]
+ TaxValue[18]
)
ร แแกแแชแ[120]
= 58,027,789.8
โ What's Improved
- Better formatted calculation display for complex expressions
- Enhanced readability for multi-step calculations
- Proper handling of nested operations and parentheses
- Support for Georgian language variable names in formatting
๐ Backward Compatibility
- All existing
FinalCalculationStepsusage continues to work unchanged - Simple Caption behavior preserved for non-named values
- No breaking changes to public API
- All 168 tests passing โ
๐ Related
Built with .NET 8.0 < /dev/null | All tests passing โ
What's Changed
Full Changelog: v1.2.1...v1.3.0
Release 1.2.1
Bump version to 1.2.1 for workflow testing Testing the improved CI/CD workflow that only runs on main branch tags. ๐ค Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
v1.2.0 - IComparable Support
๐ v1.2.0 - IComparable Support
๐ New Features
IComparable Implementation
- โ
Sorting Support: ValueWithCaption now implements
IComparableandIComparable<ValueWithCaption> - โ
LINQ Integration: Full support for
OrderBy,OrderByDescending,Min,Maxoperations - โ
Collection Sorting: Works with
Array.Sort,List.Sort, and other .NET sorting APIs - โ Type-Safe Comparisons: Comparison based on underlying decimal Value property
๐ What's Included
Core Functionality
- IComparable Interface: Compare ValueWithCaption objects based on their decimal values
- Null-Safe Handling: Proper null comparison behavior (null < any value)
- Type Safety: ArgumentException for incompatible types in non-generic CompareTo
- Immutability: Enhanced field immutability with readonly modifiers
Usage Examples
var values = new[]
{
30m.As("thirty"),
10m.As("ten"),
20m.As("twenty")
};
// Sorting
Array.Sort(values); // Now works\!
values.OrderBy(v => v).ToArray(); // LINQ ordering works\!
// Min/Max operations
var min = values.Min(); // Returns ValueWithCaption with value 10
var max = values.Max(); // Returns ValueWithCaption with value 30
// Direct comparison
var a = 15m.As("a");
var b = 25m.As("b");
Console.WriteLine(a.CompareTo(b)); // Returns -1 (a < b)๐งช Test Coverage
- 168 Total Tests (including 12 new ComparableTests)
- 100% Pass Rate โ
- Comprehensive Coverage: Basic comparisons, null handling, LINQ operations, edge cases
๐ Backwards Compatibility
โ Fully backwards compatible - no breaking changes to existing APIs or behavior.
๐ฆ NuGet Package
This release is available on NuGet as Appify.HumanReadableCalculationSteps v1.2.0
๐ Related
๐ค Generated with Claude Code
Release 1.1.1
Release 1.1.1 - LINQ Sum() Support
๐ New Features
LINQ Sum() Extension Methods
- Lambda Expression Support: Enable
res.Sum(r => r.V1.AdvanceInSalary)syntax for ValueWithCaption collections - Direct Collection Support: Support
values.Sum()for IEnumerable - Smart Caption Formatting:
- โค3 items:
A[10] + B[20] + C[30](expanded format) -
3 items:
Sum(ItemName, count(N))[total](compact format)
- โค3 items:
Integration Features
- Operator Precedence: Sum results integrate seamlessly with +, -, ร, รท operators
- Calculation Steps Preservation: All calculation steps from summed values are preserved and combined
- Real-World Scenarios: Support complex business calculations like employee advance summations
๐ Bug Fixes
- Fixed Double Parentheses: Resolved issue where Sum() expressions showed unnecessary double parentheses when combined with higher precedence operators
- Operator Precedence: Improved parentheses handling in mixed arithmetic expressions
๐ Test Coverage
- 21 New Tests: Comprehensive test coverage for all Sum() scenarios
- Integration Tests: Verification of Sum() combined with all arithmetic operators
- 154 Total Tests: All existing functionality continues to work correctly
๐ก Usage Examples
// Basic lambda expression support
var totalAdvance = employees.Sum(e => e.V1.AdvanceInSalary);
// Direct collection summation
var values = new[] { 100m.As("A"), 200m.As("B"), 150m.As("C") };
var total = values.Sum(); // Result: "A[100] + B[200] + C[150]"
// Integration with operators
var basePrices = new[] { 100m.As("Base1"), 150m.As("Base2"), 200m.As("Base3") };
var totalWithTax = basePrices.Sum() * 1.2m.As("TaxRate");
// Result: "(Base1[100] + Base2[150] + Base3[200]) ร TaxRate[1.2]"๐ Breaking Changes
None - this release is fully backward compatible.
๐ค Generated with Claude Code
v1.1.0 - Expression-based ValueWithCaption Creation
๐ Release v1.1.0: Expression-based ValueWithCaption Creation
๐ New Features
Expression-based ValueWithCaption Creation
A major new feature that allows automatic caption generation from lambda expressions, making it easier and more intuitive to create ValueWithCaption objects.
// ๐ New: Automatic caption from expressions
var price = ValueWithCaption.From(() => 100m); // Caption: "100"
var namedPrice = ValueWithCaption.From(() => basePrice); // Caption: "basePrice"
// ๐ DisplayName attribute support
public class Product
{
[DisplayName("Product Price")]
public decimal Price { get; set; }
}
var productPrice = ValueWithCaption.From(() => product.Price); // Caption: "Product Price"
// ๐ Full integration with existing operations
var tax = price * ValueWithCaption.From(() => 0.18m); // Works seamlesslyโจ Key Benefits
- ๐ฏ Automatic Caption Generation: No more string duplication or typos
- ๐ท๏ธ DisplayName Support: Built-in localization through DisplayName attributes
- ๐ง Type Safety: Compile-time safety for variable references
- ๐งฎ Full Integration: Works with all existing arithmetic operations
- โ Zero Breaking Changes: All existing functionality preserved
๐ API Reference
New Static Factory Methods
ValueWithCaption.From(Expression<Func<decimal>>)ValueWithCaption.From(Expression<Func<int>>)ValueWithCaption.From(Expression<Func<double>>)ValueWithCaption.From(Expression<Func<float>>)
Supported Expression Types
- Literals:
() => 100mโ Caption: "100" - Variables:
() => variableโ Caption: "variable" - Properties:
() => obj.Propertyโ Caption: "Property" or DisplayName value - Fields:
() => obj.fieldโ Caption: "field" or DisplayName value
๐งช Quality Assurance
- โ 133 total tests passing (16 new + 117 existing)
- โ Comprehensive test coverage for all scenarios
- โ No breaking changes to existing functionality
- โ Full backward compatibility maintained
๐ Documentation
See Issue #20 and PR #21 for detailed implementation information.
Installation: dotnet add package Appify.HumanReadableCalculationSteps --version 1.1.0
Release v1.0.4
What's Changed
๐ Publishing Enhancement
- Add GitHub Packages publishing alongside NuGet.org
- Package will now appear in GitHub's 'Packages' section
- Dual publishing for better discoverability
๐ง Workflow Improvements
- Configure GitHub Packages NuGet source automatically
- Use GITHUB_TOKEN for authentication
- Maintain existing NuGet.org publishing
Installation
From NuGet.org (recommended)
dotnet add package Appify.HumanReadableCalculationSteps --version 1.0.4From GitHub Packages
dotnet nuget add source https://nuget.pkg.github.com/AppifySheets/index.json -n github
dotnet add package Appify.HumanReadableCalculationSteps --version 1.0.4 --source githubFull Changelog: v1.0.3...v1.0.4