Skip to content

Query Result grid ignores nls.decimalSeparator/nls.groupSeparator settings for numeric columns #35

Description

@jumaragtel

Extension version: 26.2.1
VS Code version: 1.135

Settings applied (settings.json):

"sqldeveloper.database.nls.language": "SPANISH",
"sqldeveloper.database.nls.territory": "SPAIN",
"sqldeveloper.database.nls.decimalSeparator": ",",
"sqldeveloper.database.nls.groupSeparator": "."

Problem

Numeric values (NUMBER) shown in the "Query Result" grid are always rendered with the en-US format (period as decimal separator), regardless of the configured nls.decimalSeparator/nls.groupSeparator settings.

Steps to reproduce

  1. Set sqldeveloper.database.nls.decimalSeparator to "," and sqldeveloper.database.nls.groupSeparator to ".".
  2. Run SELECT 1234.56 AS amount FROM dual;
  3. Observe the "Query Result" grid.

Expected: 1.234,56
Actual: 1234.56

Root cause (found by inspecting the installed extension bundle)

In dist/extension.js and dist/connection-dialog.js, the configuration keys DatabaseNlsDecimalSeparator (sqldeveloper.database.nls.decimalSeparator) and DatabaseNlsGroupSeparator (sqldeveloper.database.nls.groupSeparator) each appear only twice in the whole bundle:

  1. Declaring the setting's key name.
  2. Declaring its {type:"string"} entry in the configuration schema (for the Settings UI).

Neither value is read anywhere else in the bundle — i.e. the setting is exposed to the user but never actually consumed (not passed to the DB session's NLS parameters, and not passed to the grid renderer).

Separately, in dist/9551.896b79c44f7bed322513.js (the bundle containing ag-Grid), there is a locale-aware number formatter used by the grid's pagination footer:

formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");
  return t?t({value:e}):function(e,t){if("number"!=typeof e)return"";
    const n=t(),o=n("thousandSeparator",","),i=n("decimalSeparator",".");
    return e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o}`)}(e,this.getLocaleTextFunc.bind(this))}

This formatter does support custom locale separators via getLocaleTextFunc, but it's only wired up for the pagination row count/page numbers — not for numeric cell values in the grid body. And since the extension never forwards the configured NLS separators into that locale function either, even the paginator wouldn't honor the setting.

Suggested fix

Wire sqldeveloper.database.nls.decimalSeparator/groupSeparator into the grid's cell value formatter/renderer for numeric columns (and, if intended, into getLocaleTextFunc for the pagination formatter too).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions