Dear Community,

 

Has anyone figured out how to keep the instance in English but have a different way of writing decimals?

Right now it looks like this:

"1.000,00" https://prnt.sc/S9vrF_TQt1dF

But we would like it to look like this:

"1,000.00" https://prnt.sc/HkloU2ovQkeM

 

The only way so far is to change our language, but that's not an option.

 

Thank you in advance!

Yosef

Like 2

Like

1 comments

did you found a solution?, we need to maintain spanish, but replace comma with  point

Show all comments

Hi,

I am using Creatio 7.14. I have a custom detail with a Price field of Decimal datatype. I know that we can define precision to 1, 2, 3, 4 or 8 decimal places. Is there a way to set it to 5? Attached is the image for the current setup of the detail.

Instead of displaying as 0.00003000, I need to display as 0.00003. 

I was able to achieve it in Detail Edit page by adding the below attribute to the field in diff:

"controlConfig": {

                        decimalPrecision: 5

                    }

 

I need to achieve the same in Detail Grid as well. I followed the community articles to create a module from scratch to extend Terrasoft.Grid:

https://community.creatio.com/questions/hyperlink-fields

https://community.creatio.com/questions/substitutionreplacing-modules

https://community.creatio.com/questions/custom-detail-hyperlink-get-fil…

 

-------------------------------------

define("UsrConfigurationGrid", ["Terrasoft.Grid"], function() {

    Ext.define("Terrasoft.configuration.UsrConfigurationGrid", {

        extend: "Terrasoft.Grid",

        alternateClassName: "Terrasoft.UsrConfigurationGrid",

        // change methods here 

        formatCellContent: function(htmlConfig, data, column) {

            if(column==="UsrTrtPrice")

            {

                data.UsrTrtPrice = parseFloat(data.UsrTrtPrice).toFixed(5);

            }

            return this.callParent(arguments);

        }

            

    });

    

    return Terrasoft.UsrConfigurationGrid;

});

-------------------------------------

Is this the correct way to do it? How should I proceed from here? Do I need to add "UsrConfigurationGrid" as a dependency in Detail Grid Page as:

----------------------------------------------

define("O1SessionDetailGrid", ["ConfigurationGrid", "ConfigurationGridGenerator",

    "ConfigurationGridUtilities","ProcessModuleUtilities","UsrConfigurationGrid"], function(ProcessModuleUtilities) {

    return {.......

----------------------------------------------

Should I remove "ConfigurationGrid" which was added to make the grid editable? The above setting does not seem to be working as the detail is not getting displayed after adding "UsrConfigurationGrid".

I would appreciate if anyone could provide any thoughts on this.

 

File attachments
Like 0

Like

3 comments
Best reply

Hi,

 

There is an easier way to achieve a custom precision for the column: in the grid detail schema you need to override the getGridRowViewModelConfig method. For example I've created a replacing view model for the OrderProductDetailV2 and specified the following code there:

define("OrderProductDetailV2", ["MoneyModule", "css!OrderPageV2Styles", "css!SummaryModuleV2"], function(MoneyModule) {
	return {
		entitySchemaName: "OrderProduct",
		messages: {},
		attributes: {},
		methods: {
			getGridRowViewModelConfig: function(config) {
				var gridRowViewModelConfig = this.callParent(arguments);
				gridRowViewModelConfig.rowConfig.UsrDecForTests.precision=6;
				return gridRowViewModelConfig;
			}
		},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

In this case all the values in the precision for the "UsrDecForTests" decimal column (that is Decimal (0.00000001) data type) in the "Products" detail on the order page will be set to 6:

and

and

So you can try the following approach on your end.

 

Best regards,

Oscar

Hi,

 

There is an easier way to achieve a custom precision for the column: in the grid detail schema you need to override the getGridRowViewModelConfig method. For example I've created a replacing view model for the OrderProductDetailV2 and specified the following code there:

define("OrderProductDetailV2", ["MoneyModule", "css!OrderPageV2Styles", "css!SummaryModuleV2"], function(MoneyModule) {
	return {
		entitySchemaName: "OrderProduct",
		messages: {},
		attributes: {},
		methods: {
			getGridRowViewModelConfig: function(config) {
				var gridRowViewModelConfig = this.callParent(arguments);
				gridRowViewModelConfig.rowConfig.UsrDecForTests.precision=6;
				return gridRowViewModelConfig;
			}
		},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

In this case all the values in the precision for the "UsrDecForTests" decimal column (that is Decimal (0.00000001) data type) in the "Products" detail on the order page will be set to 6:

and

and

So you can try the following approach on your end.

 

Best regards,

Oscar

That's exactly what I needed. Thank you, Oscar!

In freedom, is you update the datatype with multiple decimal places you need to re-add it again to the listview for the columns of that listview to update to new decimals places too.

Show all comments

Hi all,

       The default of field decimal in pre-configured page has 2 digits. How can I update it to 3 digits?

Thanks

Like 0

Like

3 comments

Hello Mai,

 

Hope you're doing well.

To perform your task you can follow the instruction which is provided in the next Community post:

 

https://community.creatio.com/questions/decimal-fields-79-decimal-posit…

 

Best regards,

Roman

Roman Rak,

I knew how to change number of decimal digits of schema, but I don't know how to change in pre-config page.

Thanks 

Hello Mai,

 

Thank you for your reply. 

 

The required kind of functionality is available starting from version 7.17 (for Section Wizard and pre-configured page):

 

Specifying the value precision when setting up numeric fields. You can select an integer or a fractional number with precision up to eight decimal digits.

Unfortunately, for older versions of the application, there is no functionality that allows you to set a decimal digit mask for pre-configured pages. Our R&D team had been informed about this functional request earlier and as for now, you can use it in the latest version of the Creatio application.

 

As a workaround, in the case when you're trying to use a basic column you need to perform the next steps:

1) Create a dummy object and add a decimal field in it, set the needed decimal digit mask. 

2) Add edit page to existing section and change field type there.

 

Also, you can try to add the following code to the needed field on the page to set the number of characters after the decimal point:

                     "controlConfig": {
                        decimalPrecision: 4
                    },

Here is an example of implementation:

 

We suggest to save the original schemas as a backup before applying any changes.

 

Best regards,

Roman

Show all comments

Hi all,

 

My case is: change decimal based on currency.

Example: when currency is USD, the decimal is 2; when currency is CAD, the decimal is 0

Pls guide me how to do that

 

Many thanks,

Phuong Nguyen

Like 0

Like

4 comments

Hello, 

 

You can create an attribute and make it dependant on the value of the column you need using Dependencies property. After that you can bind your decimal field to this attribute. Please see the academy articles below: 

https://academy.creatio.com/documents/technic-sdk/7-15/attributes-attributes-property

https://academy.creatio.com/documents/technic-sdk/7-15/adding-calculated-fields

Hi Dennis,

 

Here is my case (Order section): when I change the currency to AUD. The decimal of Total and Payment fields are 0 (it means that the number is 1,140 only)



How can I do that. Thanks

Screenshot link: https://ibb.co/MZtLYFB

 

Dennis Hudson writes:

Hi Dennis,

Here is my case (Order section): when I change the currency to AUD. The decimal of Total and Payment fields are 0 (it means that the number is 1,140 only)

How can I do that. Thanks

Screenshot link: https://ibb.co/MZtLYFB

Hello! 

Unfortunately, there is no way of conditionally changing the decimal precision for the field, it can only be set to a constant. As a workaround, you can create several fields, bind each one to the Amount column value, set the needed precision for each field, and change the visibility of these fields depending on the currency value. 

To do this you can create an attribute for each of the fields and bind fields' visibility to those attributes. To change attributes value when the currency is changed you can use dependency property: 

https://academy.creatio.com/documents/technic-sdk/7-15/attributes-attributes-property

To set the decimal precision of the field you can use decimalPrecision property: 

            {

                "operation": "merge",

                "name": "Amount",

                "values":{ 

                    "controlConfig": { 

                        decimalPrecision: 5 

                    }

                }

            }

Show all comments

Hi,

in one of your old posts you say that "it is possible to establish the accuracy of the fractional number from 1 to 4 decimal places", but in the new 7.9 there isn't the option.

Last Post: https://community.bpmonline.com/discussion/10371

We need to load "Decimal" fields wit 4 decimal places in custom fields and in the "Prices list" in Products.

Please tell me how to do that.

Thanks.

 

 

File attachments

Like

2 comments

Dear Ignacio,

In order to set prices with 4 decimal places in the Product detail "Price", please go to the "Advanced settings" --> "Configuration". 

Create a replacing object for the parent object "Product price".

Click on the "Price" column in the "Inherited Columns" folder. In the settings panel on the right you will see the options for this particular column. 

Please click onto properties button and set the tick to show all. (step 1 and 2).

Set the "data type" from currency to decimal(0.0001). (step 3)

Afterwards publish the object. The prices in the detail will be displayed with 4 decimal places.

Thanks very much Anastasia, it works.

Show all comments