How to decrease the amount of significant digits/zeroes after a decimal? Cloud

Clients have asked for there not to be 8 digits after every decimal for currencies. I saw that a solution would be to edit the $sugar_config



How do i make this change happen on a cloud instance of sugar? I believe i need to resort to the default of 2. I created a case but they said there was nothing they could help with beyond pointing me at this 9-year old feature request (https://portal.sugarondemand.com/#supp_Bugs/71713). Any ideas?

Parents
  • In the profile settings of each user you can set the default precision of that user.

    The value in config.php is only the default value when a new user is created and in new versions it is 2.

    The database precision of each currency field is defined by its vardef definition. So, you can define different precisions for all your currency fields by specifying them in custom/Extensions/modules/*/Ext/Vardefs/ files.

    E.g. like this:

    <?php
    $dictionary['Bug']['fields']['cur6_c']['labelValue']='cur8';
    $dictionary['Bug']['fields']['cur6_c']['enforced']='';
    $dictionary['Bug']['fields']['cur6_c']['dependency']='';
    $dictionary['Bug']['fields']['cur6_c']['precision']=8; // <<<< HERE
    $dictionary['Bug']['fields']['cur6_c']['related_fields']=array (
      0 => 'currency_id',
      1 => 'base_rate',
    );

    As a result the field will be created in the database as  decimal(26,8).

    Whether this makes sense depends on the usecases.

Reply
  • In the profile settings of each user you can set the default precision of that user.

    The value in config.php is only the default value when a new user is created and in new versions it is 2.

    The database precision of each currency field is defined by its vardef definition. So, you can define different precisions for all your currency fields by specifying them in custom/Extensions/modules/*/Ext/Vardefs/ files.

    E.g. like this:

    <?php
    $dictionary['Bug']['fields']['cur6_c']['labelValue']='cur8';
    $dictionary['Bug']['fields']['cur6_c']['enforced']='';
    $dictionary['Bug']['fields']['cur6_c']['dependency']='';
    $dictionary['Bug']['fields']['cur6_c']['precision']=8; // <<<< HERE
    $dictionary['Bug']['fields']['cur6_c']['related_fields']=array (
      0 => 'currency_id',
      1 => 'base_rate',
    );

    As a result the field will be created in the database as  decimal(26,8).

    Whether this makes sense depends on the usecases.

Children
No Data