Hi all, I have several number fields with the format: "0.###". But when I try to change it (even using the "Add language facilities" feature) to "0,###", I get the following error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at org.colos.ejs.library.control.swing.ControlNumberField.setValue(Unknown Source) at org.colos.ejs.library.control.ControlElement.setProperty(Unknown Source)
The Format field requires a dot '.' and not a comma ','. The dot is used to indicate where the decimal part begins.
If you are using the Field element (it displays a "2.0" in its icon), this element displays decimal points using the English format, that is something like "3.1415". We need this because the element actually parses the value. So, you can enter expressions like "2.0*3.15" or even "2*pi".
The older - actually deprecated, but still usable- Field_old (which displays a "1.0" in its icon) is able to accommodate to the local language. Hence, this older element, for a given format like "0.###" would display "3.145" in an English computer and "3,145" in a Spanish computer. (To bring in deprecated - older- view elements, check the "Show panels of deprecated elements" in the "Aspect" tab of the EJS options dialog.)
That's the best we can do. But recall, no matter which element you use, you must specify the Format property using the correct syntax (which uses always a '.' ). Translation does not let you change the "0.000" to "0,000". You would translate to change, f.i., "Force = 0.00" to "Forza = 0.00".
I understand the issue with the Format field now. And yes, I'm using the new Field element, all over the place actually, so I'll have to consider if it is worth it to make the change and use the older one instead. Also, apart from loosing the ability to enter complex expressions, is there any caveat on replacing the 2.0 Field with the 1.0 Field?