# Locale formatting issue in Perspective (pt-BR) – numberFormat ignores regional settings

**URL:** <https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [July 25, 2025, 12:01pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947 "2025-07-25T12:01:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davi.soares](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@davi.soares](https://forum.inductiveautomation.com/u/davi.soares)\
**Post date:** [July 25, 2025, 12:01pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947/1 "2025-07-25T12:01:48Z")

</div>

Hello everyone,

I'm facing an issue with number formatting in Perspective using the `numberFormat` transform.

In Brazil (pt-BR), we use the period `.` as the thousands separator and the comma `,` as the decimal separator. However, even after properly configuring the locale as `pt-BR` in:

- **Project Properties** : _Perspective \> General \> Project Locale = português (Brasil)_
- **Session Props** : _session.props.locale = pt-BR_

…the `numberFormat({value}, '###,##0.00')` still renders the number in US/EN format (e.g., `1,000.00` instead of `1.000,00`).

I’m trying to avoid using scripting inside the binding expression due to performance concerns and because I apply this transformation across many views.

* * *

**What I tried:**

I was able to solve it partially by using a `Format` map transform (type: `format`, with `pattern` and `locale` properties). This approach works for fixed patterns.

However, my formatting pattern is dynamic — it comes from a parameter in my UDTs — and the `Format` map transform does not allow binding to its `pattern` or `locale` properties. This limitation prevents me from dynamically adjusting the format per tag instance.

* * *

**Question:**

Is there a clean and efficient way to:

1. Use `numberFormat` or `Format` transform while respecting the `pt-BR` locale formatting (without script)?
2. Bind the `pattern` dynamically to a tag/parameter when using `Format` transform?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7aa4e2141dddc182b2b554ea15b154bf85e2b371.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89b79c42c479b9d19fb1f81b5e3d628f5fb7554b.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cb29f55115567c8688414cc21f762e669e86bcd3.png)

Any advice or workaround would be appreciated. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 25, 2025, 2:44pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947/2 "2025-07-25T14:44:58Z")

</div>

I think you're going to have to use a script, unfortunately. The `numberFormat` expression function follows the overall **gateway** locale; it's not aware of the individual Perspective session locale the way e.g. `translate` is. That's an oversight on our part that we can fix, but it won't happen for quite a while. Unless changing the gateway itself to `pt-BR` is an option.

---

<div class="post-metadata">

**Author:** ![davi.soares](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@davi.soares](https://forum.inductiveautomation.com/u/davi.soares)\
**Post date:** [July 25, 2025, 3:14pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947/3 "2025-07-25T15:14:41Z")

</div>

Thanks for the clarification.

When you mentioned "changing the gateway locale," I assumed you were referring to changing the region settings of the **operating system running the Gateway**. I’ve already updated the OS locale to `pt-BR` and restarted the Gateway, but unfortunately the number formatting behavior hasn’t changed — the `numberFormat` function still uses the default (en-US) separators.

Let me know if there’s another way to set the locale specifically for the Gateway itself, other than through the OS.

**Is it possible to configure the locale directly in the Gateway?** I checked under _Config \> System \> Gateway Settings_, but couldn’t find anything related to locale.

---

<div class="post-metadata">

**Author:** ![Noah\_Casey](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@Noah\_Casey](https://forum.inductiveautomation.com/u/Noah_Casey)\
**Post date:** [July 25, 2025, 3:35pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947/4 "2025-07-25T15:35:07Z")

</div>

You can set the locale in the perspective session properties:

In our projects we store user settings so that users can pick and choose locales/languages then save that setting:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bbe07045aea995912dc4a936928b7f05586cff79.png)

If it will always be the same you can statically set it.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 25, 2025, 3:46pm UTC](https://forum.inductiveautomation.com/t/locale-formatting-issue-in-perspective-pt-br-numberformat-ignores-regional-settings/108947/5 "2025-07-25T15:46:49Z")

</div>

You can provide an explicit locale to the gateway by providing explicit language and country parameters:

> **[Gateway Configuration File Reference | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/gateway-configuration-file-reference#common-localization-parameters)**
>
> This section details the various configuration changes that can be made to the Gateway's configuration file: ignition.conf. Before the Gateway starts, a wrapper service checks the configuration file for parameter values, and then attempts to start...

You can test by running `system.util.getLocale()` somewhere on the gateway (but **not** Perspective), such as a report/alarm pipeline/tag script/etc.
