Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion content/en/docs/refguide/modeling/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Mendix supports the following data types:
| Boolean | A truth value. | `true` and `false` |
| Binary | Binary data such as files and images. | |
| Date and time | A point in time consisting of a date and a time component accurate up to milliseconds. | Thursday, 12 February 2015, 14:50:36 |
| Decimal | A high-precision fractional number. The Decimal type can be used for high-precision calculations. Use this type to represent amounts of money for example. A Decimal can have up to 20 digits before the decimal point, and up to 8 after. | 3.14, 738000000000.00000001 |
| Decimal | A high-precision fractional number. The Decimal type can be used for high-precision calculations. Use this type to represent amounts of money for example. A Decimal can have up to 20 digits before the decimal point, and, from Mendix 11.6.0, is configurable between 8 up to 18 after. In versions below 11.6, a Decimal can only have up to 8 digits after the decimal point. | 3.14, 738000000000.00000001 |
| Enumeration | One of the values of the given [enumeration](/refguide/enumerations/). | Red, Green, Blue; Todo, Running, Done |
| <a id="integer-long"></a>Integer/Long | A whole number between -(2^63) and 2^63 - 1. The attribute types AutoNumber, Integer and Long map to this data type. | -42, 0, 123 |
| List | A list of objects of a specific [entity](/refguide/entities/). | |
Expand All @@ -30,3 +30,17 @@ Mendix supports the following data types:
If you want to change data from one type to another (for example, to display a number as part of a message in a text box) you will usually need to use an expression to do this. See [Expressions](/refguide/expressions/) for more information on what is available.

An exception is converting an Integer/Long to a Decimal, where conversion is done implicitly if you provide an Integer/Long where a Decimal is expected.

## Configurable Decimal Scale {#configurable-decimal-scale}

{{% alert color="info" %}}
Decimal scale is configurable in Mendix version 11.6.0 and above.
{{% /alert %}}

As mentioned above, the scale of a decimal is configurable between the values of 8 and 18, where precision will always be scale + 20. The setting under `App Settings` will apply to the entire application.

{{< figure src="/attachments/refguide/modeling/data-types/decimal-scale-setting.png" >}}

When you adjust the scale of a decimal precision, you will also need to adjust usages of the decimal in frontend elements such as datagrids to respond to the changes. By default, frontend components format decimals with a fixed scale of 2. When specifying `fixed` formatting, the UI will display the value rounded or padded to fit into the fixed format. For example, `1.2345` will result in `1.23` when selecting 2 and `1.23450` when selecting 5. When `Auto` formatting is specified, the UI will display the value as it is stored.

{{< figure src="/attachments/refguide/modeling/data-types/decimal-scale-formatting.png" >}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.