Resolving Ignition Perspective Table Locale Number Format

Claire Rousseau5 min read
HMI / SCADAOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Symptom and Root Cause

A Perspective Table bound to a named query renders a numeric column (here TRANSPORT) with US separators: a period as the decimal mark and a comma for thousands. The browser and operators are Swedish, so the expected output uses a decimal comma and space grouping. Changing the column number format in the property editor does not change the separators. A script transform on the data binding that colors rows does not change the output either.

The database does not store a format. A numeric column holds a binary value, and the named query passes it to Perspective as a number. The decimal and grouping characters are applied at render time in the browser, based on the session locale. The column number format pattern controls digit count, rounding, and whether grouping is shown. The separator characters come from the locale. If the client never loads the browser locale, every pattern renders with default US separators.

This is a known client defect. On Ignition 8.1.35, Perspective fails to load the locale from the browser for table number rendering. It is tracked as BUG 7305: "Perspective Table Number format not changing according to the selected Locale." A Numeric Entry Field on the same view forces locale-aware number formatting to initialize. After that, the table renders with the correct separators.

Approaches Compared

Approach Fixes separators on 8.1.35 Column stays numeric (sort/filter) Follows each client's locale Drawback
Column number format in property editor No Yes Yes, once the bug is fixed The pattern cannot override the separators while the locale is not loaded
Hidden Numeric Entry Field on the same view Yes Yes Yes One extra component per affected view; easy to delete by mistake
Format values to strings in the script transform Yes No No, the locale is hard-coded Text sorting breaks numeric order; column formatting no longer applies
Upgrade to a release that resolves BUG 7305 Yes Yes Yes Needs a gateway maintenance window; check the release notes for the fix version

Recommendation: apply the hidden Numeric Entry Field now and schedule the upgrade. Do not convert numbers to strings in the transform. That trades a display bug for broken sorting and a fixed locale, which is wrong for any English-language client.

Prerequisite Checks

Before anything else, confirm the problem is the locale defect and not bad data. Do not move on until each check passes.

  1. Gateway version. Read the version on the Gateway status page. The workaround was confirmed on 8.1.35. On other 8.1.x builds, search the release notes for BUG 7305 to see whether your build is affected.
  2. Returned data type. Run the named query in the Designer test pane and inspect TRANSPORT. If the values come back as text, locale formatting never applies. Cast the column to a numeric type in the SQL first.
  3. Session locale. Bind a temporary Label to the session's locale property and open the view in a browser. A Swedish value confirms the bug path. An English value means the browser language setting is wrong, which is a separate problem.
  4. Transform output. Open the script transform that sets row colors. Wrapping a cell in a value/style object is fine. The value itself must stay an int or float.
# Breaks locale rendering: the cell becomes text
value = '%.2f' % row['TRANSPORT']

# Correct: pass the native number, style the row separately
value = row['TRANSPORT']

Hidden Numeric Entry Field Procedure

  1. Open the view that contains the Table in the Designer. Confirm it is the view that hosts the Table directly, not a parent page.
  2. Drag a Numeric Entry Field from the component palette into that view.
  3. Rename it to something explicit, such as LocaleFix, so nobody deletes it as an unused component.
  4. Set its visibility to false. It does not need a binding or a value.
  5. In a flex container, confirm the hidden component does not reserve space or shift the Table. In a coordinate container, placement does not matter.
  6. Save the project. In the browser, do a full reload of the session, not just a view navigation, so the client re-initializes.
  7. Repeat for every view with a locale-sensitive Table. If you want a single instance in an always-loaded docked view, test each page before relying on it. The confirmed placement is on the same view as the Table.

Leave the column number format pattern set to the digits and grouping you want. Once the locale loads, the pattern applies with Swedish separators.

Recurring Pitfalls

Pitfall Effect Countermeasure
Testing only in the Designer preview The preview does not use the browser's locale, so results differ from the client Verify in a real browser session with the target language
Numeric Entry Field deleted during cleanup The bug silently returns on that view Use a descriptive name and record it in the project documentation
Transform returns formatted strings The locale fix appears to fail; sorting goes lexicographic Keep native numbers in the transform output
Swedish-formatted strings stored in the database Values arrive as text; no formatting applies Store numeric types, or cast in the named query
Workaround left in place after the upgrade Harmless, but it hides whether the fix works After upgrading, remove it on one view and retest

Verification

  1. Set the browser language to Swedish, then hard-reload the Perspective session.
  2. Check TRANSPORT. It should show a decimal comma and Swedish thousands grouping, with the decimal count set by the column pattern.
  3. Sort TRANSPORT ascending. Single-digit values must sort before two-digit values. That confirms the column is still numeric.
  4. Check that row colors from the script transform still apply to the same rows as before.
  5. Switch the browser language to English and reload. TRANSPORT must change to a period decimal mark. That confirms the formatting follows the client locale.

FAQ

Why does my Ignition Perspective table show US number format when the browser is set to Swedish?

On 8.1.35, Perspective fails to load the browser locale for table number rendering. This is tracked as BUG 7305. The table falls back to US separators whatever column number format you set.

Why does a hidden Numeric Entry Field fix the Perspective table decimal separator?

Placing a Numeric Entry Field on the same view forces the client to initialize locale-aware number formatting, and the Table then uses it. It still works with visibility set to false, and it needs no binding.

Why does formatting numbers in the script transform break table sorting?

Formatting turns each cell into text, so the Table sorts characters instead of values. It also fixes one locale for every client. Keep native numbers in the transform and let the column number format and session locale handle display.

Back to blog