Table of Contents
Data Editor - Value Formatting
[PRO]
Starting with Valentina Studio Pro 11.4.3 it is possible to apply various formatting options to values in the Data Editor, depending on their types. Some options are universal and some are available only to certain database engines.
Integer Values
Fields of integer types have the following formatting actions:
- Decimal
- Hexadecimal
- Binary
- Octal
- Set Suffix…
Different formatting options are presented in the following table:
Additionally, you can set a suffix for the value using “Set Suffix” action.
For example, to format information about the length of the film:
After changing the format a “Reset Format” action is added to the menu, use it to switch to the default formatting.
Floating-Point Value
Use the “Set Format…” action to define formatting for floating-point values:
Floating-point (e.g. Float, Double, Decimal, Real, Money) values have more formatting options, they can be defined in a specialized dialog:
- Currency – choose the currency from the list to show its sign near value.
- Precision – the number of digits after the decimal separator.
- Scientific – present value in scientific notation (not available for currency values).
- Suffix – add text after the value (e.g. “ mm”).
Examples:
Date&Time Values
The format of Date&Time values is defined using the following dialog:
A placeholder shows the default format.
Click “?” button to view the reference on available formatting options:
This dialog is non-modal, so it is possible to switch back to the main dialog. Also, the same reference is shown in a tooltip of the “?” button.
Input Mask
For the textual fields, it is possible to set an input mask to restrict user input to certain format.
Open the context menu and click “Set Input Mask”:
Click “?” button to view characters to compose the mask.
Mask Character | Meaning |
---|---|
A | character of the Letter category required, such as A-Z, a-z. |
a | character of the Letter category permitted but not required. |
N | character of the Letter or Number category required, such as A-Z, a-z, 0-9. |
n | character of the Letter or Number category permitted but not required. |
X | Any non-blank character required. |
x | Any non-blank character permitted but not required. |
9 | character of the Number category required, e.g 0-9. |
0 | character of the Number category permitted but not required. |
D | character of the Number category and larger than zero required, such as 1-9 |
d | character of the Number category and larger than zero permitted but not required, such as 1-9. |
# | character of the Number category, or plus/minus sign permitted but not required. |
H | Hexadecimal character required. A-F, a-f, 0-9. |
h | Hexadecimal character permitted but not required. |
B | Binary character required. 0-1. |
b | Binary character permitted but not required. |
Meta Character | Meaning |
---|---|
> | All following alphabetic characters are uppercased. |
< | All following alphabetic characters are lowercased. |
! | Switch off case conversion. |
;c | Terminates the input mask and sets the blank character to c. |
[ ] { } | Reserved. |
\ | Use \ to escape the special characters listed above to use them as separators. |
This dialog is non-modal, so it is possible to switch between two dialogs.
After setting a mask, you can use the “Format” menu to reset or modify the mask.
For example, an input mask for the phone numbers:
While editing empty characters are replaced with “_” placeholders.
PostgreSQL
The following set of formatting options is available only for PostgreSQL databases.
Interval Values
PostgreSQL has a dedicated field type for storing interval values. It is possible to format data of these fields using the following formats:
- SQL
- Postgres
- Postgres Verbose
- ISO 8601
Geometric Values
Point
Line
Line Segment
Polygon
Path
Box
Circle
XML Values
XML fields have the “Format XML” option:
With formatting, tags are automatically indented, special characters are escaped.
JSON Values
MAC Address Values
The values of macaddr and macaddr8 types can be formatted with different delimiters.
macaddr:
- 08:00:2b:01:02:03
- 08-00-2b-01-02-03
- 08002b:010203
- 08002b-010203
- 0800.2b01.0203
- 0800-2b01-0203
- 08002b010203
macaddr8:
- 08:00:2b:01:02:03:04:05
- 08-00-2b-01-02-03-04-05
- 08002b:0102030405
- 08002b-0102030405
- 0800.2b01.0203.0405
- 0800-2b01-0203-0405
- 08002b01:02030405
- 08002b0102030405