This is a a question about the Beckhoff product TE2000 | TwinCAT 3 HMI Engineering. (using
v1.12.760.48)
What is the best approach to localizing numeric data, whilst still allowing two-way binding of numbers?
By default, the TwinCAT HMI uses a dot as the decimal separator.
However, our customer has the requirement that they should see a number with a comma as a decimal separator (nl-NL locale).
How is this best achieved?
My first thought was to use a Javascript function, which uses a centralized (localized) formatter, but doing so will transform the number into a string, and I will lose the possibility for a two-way binding.
I already assigned the locale nl-NL to the logged in user, but to no avail.
Other things I have tried are setting the <html lang=”nl-NL” … /> attribute, but this does not seem to help either. When injecting pure HTML into the content, this attribute does seem to have the desired effects on plain HTML input fields (see code snippet + screenshot below), but I would like to use the TE2000 framework elements.
Code snippet for hosting plain HTML inside of the HMI content
<div id="TcHmiHtmlHost" data-tchmi-type="TcHmi.Controls.System.TcHmiHtmlHost">
<input type="number" value="12.9">
</div>
TwinCAT HMI textbox (top) vs. HTML input (bottom) in locale nl-NL (firefox)