Decimal separator - Site property - Vanilla Theme

Decimal separator - Site property - Vanilla Theme

  

Hi to everyone,

First of all excuse me for this newbie question but I am still struggling to learn Outsystems. I've recently completed on of the Outsystems learning units. In the default theme site settings I came across one which was very interesting - Decimal Separator (screenshot attached). Once I've started building my own app with the Vanilla Theme I cannot find this setting anymore (maybe it's not even related to the theme itself). As a workaround I've created the site property "DecimalSeparator" manually and added the default value as "," (comma) but it does not work. 

Is there any way to setup the default decimal separator to a comma and perhaps also the default currency?

Hi Rok,

1. Site properties are "module specific", meaning they are available only inside the module they were created.

To make them available to other modules, you need to create a server action, defined as public, in the module that the site property is, and make it that return the site property's value. Than you can reference this action on other modules to get the value.

2. Regarding the decimal format site property, it is not used by the platform automatically, but you can use the site property when you are formatting a decimal value to show in screen, as one of the parameters of this function is the decimal format. See the format functions here: https://success.outsystems.com/Documentation/10/Reference/Logic/Built-in_Functions/Format_Built-in_Functions

Cheers,

Eduardo Jauch

P.S

You can think of site properties as module local variables (visible on all actions of a module), that have a default value defined when published first time, but that you can change in Service Center (without having to republish the code).

Their main purpose is to provide general parameterized configuration.

Cheers

Eduardo Jauch

Eduardo Jauch wrote:

Hi Rok,

1. Site properties are "module specific", meaning they are available only inside the module they were created.

To make them available to other modules, you need to create a server action, defined as public, in the module that the site property is, and make it that return the site property's value. Than you can reference this action on other modules to get the value.

2. Regarding the decimal format site property, it is not used by the platform automatically, but you can use the site property when you are formatting a decimal value to show in screen, as one of the parameters of this function is the decimal format. See the format functions here: https://success.outsystems.com/Documentation/10/Reference/Logic/Built-in_Functions/Format_Built-in_Functions

Cheers,

Eduardo Jauch

Thanks Eduardo! 

Just an additional explanation, if my understanding is correct the FormatDecimal function should be used on each form(web screen) where a decimal value is displayed right? I mean there is no "global" setting that can be set up so every field containing a decimal value is using the function automatically?

Thank in advance!


Solution

Hello Rok.

As far as I know (and I may be wrong here), the platform uses the configuration of the server. It is possible to change in Service Center the default Date Format, but I don't know of an option for Decimal separator and group separator.

Usually, if decimals must be displayed in a specific format, we use the Format function.

Cheers,
Eduardo Jauch

Solution

Thanks Eduardo, much appreciated!