Skip to content

Conversation

@alex-bochkov
Copy link
Contributor

Motivation

  • Display numeric values in the grid with locale-aware thousands separators so numbers like 39219883 appear as 39,219,883 (or with . depending on locale).
  • Preserve decimal precision when formatting numeric strings returned by the grid.
  • Support common numeric SQL types (money, smallmoney, decimal, numeric, float, real, etc.) in formatting.
  • Update the displayed grid values in-place when possible via the grid storage API.

Description

  • Added using System.Globalization and helper methods TryFormatNumberWithGroupSeparators, GetDecimalPlaces, GetGridStorageSetCellDataMethod, and TrySetGridStorageCellData to perform culture-aware formatting and reflection-based updates.
  • Expanded the numeric type list and collect columnsToFormatNumbers in SQLResultsControl_ScriptExecutionCompleted, then iterate rows to format numeric cell text and write back using the detected set-cell method.
  • Detect candidate set-cell methods (SetCellDataAsString, SetCellDataFromString, SetCellData) via reflection and invoke them with appropriate parameter conversions.
  • Preserve the existing right-alignment behavior and only update cell contents when the formatted value differs from the original.

Testing

  • No automated tests were run on this change.

Codex Task

@alex-bochkov alex-bochkov changed the title Format numeric grid values with locale-specific thousands separators TEST - Format numeric grid values with locale-specific thousands separators Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants