I'm trying to change the decimal separator from .
to ,
on a gauge or text.
I'm using Google Chrome as browser and the default locale is set to fr-FR
.
I've already tried
-
Default
{{msg.payload | number:1 }}
-
{{msg.payload | number:1:fr }}
and{{msg.payload | number:1:fr-FR }}
— see Angular documentation DecimalPipe -
{{msg.payload | number:1| replace:'.':',' }}
— see Angular Pipe Replace character
to no avail.
I've also explored
this time successfully, although only after having installed sudo npm install -g @angular/localize
.
However, number:1:en-US
has no effect, ie. the decimal separator is ,
while it should be .
. So the locale format seems to be hard-coded.
And the file ~/.node-red/node_modules/node-red-dashboard/dist/i18n.js
says prominently
Placeholder only - This is NOT a sustainable solution to i18n localisation
Is there a better solution available? Thank you!
The flow example is attached below.
[{"id":"7a3218c8.cd6598","type":"ui_button","z":"44a96459.97cf0c","name":"","group":"c89fdb8b.3993a","order":3,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"123.45","payloadType":"num","topic":"","x":230,"y":200,"wires":[["7452882a.6e9dd","a99b8db7.a620f8","8f2f75f2.d093e","6558710d.ce2238","1d7ca451.8ef79c"]]},{"id":"7452882a.6e9dd","type":"ui_text","z":"44a96459.97cf0c","group":"c89fdb8b.3993a","order":2,"width":0,"height":0,"name":"","label":"number:1:fr","format":"{{msg.payload | number:1:fr }}","layout":"row-spread","x":570,"y":220,"wires":[]},{"id":"a99b8db7.a620f8","type":"ui_text","z":"44a96459.97cf0c","group":"c89fdb8b.3993a","order":2,"width":0,"height":0,"name":"","label":"number:1","format":"{{msg.payload | number:1 }}","layout":"row-spread","x":560,"y":160,"wires":[]},{"id":"8f2f75f2.d093e","type":"ui_text","z":"44a96459.97cf0c","group":"c89fdb8b.3993a","order":2,"width":0,"height":0,"name":"","label":"number:1:fr-FR","format":"{{msg.payload | number:1:fr-FR }}","layout":"row-spread","x":580,"y":280,"wires":[]},{"id":"6558710d.ce2238","type":"ui_text","z":"44a96459.97cf0c","group":"c89fdb8b.3993a","order":2,"width":0,"height":0,"name":"","label":"number:1 | replace:'.':','","format":"{{msg.payload | number:1 | replace:'.':',' }}","layout":"row-spread","x":610,"y":340,"wires":[]},{"id":"1d7ca451.8ef79c","type":"ui_text","z":"44a96459.97cf0c","group":"c89fdb8b.3993a","order":2,"width":0,"height":0,"name":"","label":"number:1:en-US","format":"{{msg.payload | number:1:en-US }}","layout":"row-spread","x":590,"y":400,"wires":[]},{"id":"c89fdb8b.3993a","type":"ui_group","z":"","name":"Default","tab":"8b54c72b.4f0cf","order":1,"disp":true,"width":"6","collapse":false},{"id":"8b54c72b.4f0cf","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]```