[01415] Fix DataTable footer concatenated currency formatting#2911
Merged
nielsbosma merged 1 commit intomainfrom Apr 2, 2026
Merged
[01415] Fix DataTable footer concatenated currency formatting#2911nielsbosma merged 1 commit intomainfrom
nielsbosma merged 1 commit intomainfrom
Conversation
The Footer() method was building footer strings via string interpolation without applying the column's FormatStyle, Currency, or Precision settings. This caused currency columns to display concatenated raw values (e.g. "$10,543.56$150,587.95") instead of a properly formatted sum. Added FormatFooterValue helper that applies the column's number formatting (Currency, Percent, Decimal) to aggregate results, and GetCultureForCurrency to resolve ISO currency codes to the correct CultureInfo for formatting.
Collaborator
Deploy timed outI'm preparing your docs & samples for this PR. I'll update the comment as Sliplane reports progress. Logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed the DataTable footer to properly format aggregate values using the column's
FormatStyle,Currency, andPrecisionsettings. Previously, theFooter()method used rawToString()on aggregate results, causing currency columns to display concatenated raw strings (e.g.$10,543.56$150,587.95) instead of formatted sums like$161,131.51.Changes
Backend fix:
src/Ivy/Views/DataTables/DataTableBuilder.cs— AddedFormatFooterValueandGetCultureForCurrencyprivate static methods; updated bothFooter()overloads to use them.Tests:
src/Ivy.Tests/Views/DataTables/DataTableFooterFormatTests.cs— New test class with 5 tests covering Currency, Percent, Decimal, no-format passthrough, and multiple aggregates.API Changes
None. The fix is internal to
DataTableBuilder<TModel>— the publicFooter()API is unchanged but now produces correctly formatted output.Commits