Stupid question : I have a number type field showing on a form, that should display 2 decimal places (for dollars and cents) - so far so good. I want to allow negative values in that field, but if I try to do this, the field content turns red and I have to escape out of the field to revert it to the previous value. I have tried different combinations of the format properties with the pipe character, but it seems to work one way but not the other. Can anyone point me to a solution?
On a related question: How can I specify a space as my thousands separator in the format properties? (ie: 1 842 329,95$)
Lastly: Is there a resource available showing all the different masks and mask options available to us?
Thanks for the link, Marcel (BTW, great presentation the other day!). Still need some help with the string I have to put in the format properties, though…
I’ve tried ‘AAA AAA.AA’ and other combinations, but I’m stuck.
Try this format “#,##0.00$”. I will not use spaces though, but replace the grouping character “,” and the decimal separator “.” character according to the locale.
Currently it is not possible to replace these decimal format symbols with custom ones, but you can make a feature request here (it is not complicated to implement - only have to find a nice way to specify those custom chars):
For more details about number formatting you can check out the Servoy Developer Reference Guide (also contains info about date/text formatting) or JDK 23 Documentation - Home
Thanks Andrei for the excellent suggestions - “#,##0.0#;-#|#,##0.0#;-#” did the trick ( the format of negative numbers for my locale was probably using parentheses).
The referenced documentation is also very enlightening. Not sure if I should make a request to override the user’s locale, though - will think about it.