Conditional formatting in Mask property of [String] field

RSZ-EC

Member
Hi everybody!

Working in version 5, I need to return a numeric value with sign always expressed. By now, I use a long-step method, using [1(Value)], and if it not a minus, adding a plus sign.

I wonder if there's a way to avoid inflating my database with more [Composite] and [String] fields for such trivial task. Maybe a conditional formatting in the Mask property of a [String] field, such as "+#.##;-#.##" so positive values get a plus sign and negative value keep its sign?

BTW, where can I find a list with all formatting options of Mask property?

Thanks in advance!
 

Anti

Administrator
Staff member
Hi, Rommel!

If the task is only to always have a sign before the number, then the String function in the Сomposite field is enough.
[String(Number>0?+:)][Number]

Hope this helps.
 
Last edited:

Anti

Administrator
Staff member
About the mask.
The table below shows the characters that can be used in an input mask. A space character, the default character for a blank, is needed for cases where a character is permitted but not required.

CharacterMeaning
AASCII alphabetic character required. A-Z, a-z.
aASCII alphabetic character permitted but not required.
NASCII alphanumeric character required. A-Z, a-z, 0-9.
nASCII alphanumeric character permitted but not required.
XAny character required.
xAny character permitted but not required.
9ASCII digit required. 0-9.
0ASCII digit permitted but not required.
DASCII digit required. 1-9.
dASCII digit permitted but not required (1-9).
#ASCII digit or plus/minus sign permitted but not required.
HHexadecimal character required. A-F, a-f, 0-9.
hHexadecimal character permitted but not required.
BBinary character required. 0-1.
bBinary character required. 0-1.
>All following alphabetic characters are uppercased.
<All following alphabetic characters are lowercased.
!Switch off case conversion.
[ ] { }Reserved.
\Use \ to escape the special characters listed above to use them as separators.

Some examples of masks:
MaskNotes
000.000.000.000;_IP address; blanks are _.
HH:HH:HH:HH:HH:HH;_MAC address
0000-00-00ISO Date; blanks are space
>AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#License number; blanks are - and all (alphabetic) characters are converted to uppercase.
 

RSZ-EC

Member
Hi, Rommel!

If the task is only to always have a sign before the number, then the String function in the Сomposite field is enough.
[String(Number>0?+:)][Number]

Hope this helps.
Thank you so much! It works as I needed!

Now, my database has two fields less... only if I could put nested [String()] functions in my [Composite] fields it would be perfect. ;)
 

Anti

Administrator
Staff member
only if I could put nested [String()] functions in my [Composite] fields it would be perfect.
In the future, it is planned to add processing for other Composite fields in the Composite field formula.
 
Top