How to Set the Length and Decimal place for Percentage field in Salesforce

In this Salesforce tutorial, we will learn how to set the length and decimal place for the percentage field in Salesforce.

For learning this process you have come to the right place and we learned this topic in both the editions of Salesforce Lightning and Salesforce Classic.

How to set the length and decimal place for the percentage field in Salesforce Lightning

Here we will learn how to set the length and decimal place for the percentage field in Salesforce Lightning. Let us take an example to clearly understand the scenario, We can manage the showing format of the percentage field by setting the decimal places values in the field.

Here we are working with the custom object product but we can select any custom object for setting the length and the decimal place in Salesforce here we want to create a custom percentage field to trace the profit margin for each and every product.

For tracing the profit margin we are setting the length and decimal place of the profit margin percentage field.

Here are the following steps:

1. log in to the Salesforce Lightning account, by simply entering the credential and directly logging into the Salesforce Lightning account. Click on the gear icon that is present at the top right corner.

2. Under this gear icon, the setup option is present. Click on the setup option. Our setup page is open, under this page the object manager tab is present on the nav bar. Click on the object manager tab.

How to set the length and decimal place for the percentage field in Salesforce

3. The Object Manager page is open. Under this object manager tab, lots of objects are present, Select one of the objects from the lots of objects and we can also choose our object by simply entering the object in the search box and here we are entering the product in the search box.

4. The product object comes at the top, and select the product object from the object manager page.

How to set the length and decimal place for the percentage field in Salesforce Lightning

5. The product object page is open And under this page, we can see the details related to the object. On the left side of the product object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

Set the length and decimal place for the percentage field in Salesforce

6. After clicking on the Field and Relationship option of the product object, The product Fields and Relationships page is open, and under this page lots of fields are present but we want to create a new field for setting the length and decimal places. Click on the new button.

Set the length and decimal place for the percentage field in Salesforce Lightning

7. After clicking on the new button, the data type page is open. Under this page lots of datatypes are present. Here we are selecting the percentage data type, scroll to the bottom of the page.

8. Percentage data type is present, Click on the percentage checkbox and then click on the next button.

Salesforce set the length and decimal place for the percentage field

9. Now enter the details related to the new custom field here first enter the field label as Profit Margin and then set the length and the decimal place the length is the number of digits to the left of the decimal point and the decimal place is the number of the digits to the right of the decimal point.

10. After that enter the field name which is automatically filled and then click on the next button.

Salesforce Lightning set the length and decimal place for the percentage field

11. Now establish the field level security, select the profile to which we want to grant the edit access to this field via a field level security. The field will be hidden from all the profiles if we do not add it to field level security then check the visible checkbox for the profiles that are added to the field level security and then click on the next button.

How to set a length and decimal place for the percentage field in Salesforce

12. Here we are adding the custom field to the page layout, select the page layouts that should involve this field. The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if we do not select a layout.

13. For changing the location of this field on the page, we will need to customize the page layout. After that click on the save button.

How to set length and decimal place for the percentage field in Salesforce

14. Our Profit Margin percentage field is created and we come back to our fields and relationships page under this page we can see that the profit margin with a percentage field with 18 lengths and 0 decimal places is shown.

how to set length and decimal place for the percentage field in Salesforce Lightning

15.  Go to the App Launcher, enter the sales in the search box and the sales option comes at the top. Select the sales option. The sales page is open and under this sales page, we can see that lots of objects are present at the nav bar. Select one of the objects.

16. Here we are selecting the product object, The product record page is open and under this page lots of records are present and we want to create a new record. For creating the new record click on the new button that is present at the top of the product record page.

17. After clicking on the new button, the new product dialogue box is open. Now fill in the complete information related to the product. First, fill in the Product name and then fill the product website this field is filled by default.

18. After that fill the product description and after that fill the profit margin which is the percentage field here we enter the 84 and convert it into a percentage and then click on the save button.

Set length and decimal place for the percentage field in Salesforce Lightning

19. After saving the record, the record is present under the product record page. Click on the Salesforce Product record, and the Salesforce Product record page will open under this page, we can see the details related to the Salesforce Product record when we click on the detail option, and under this detail page, we can see the profit margin field which is a percentage field type.

Salesforce set length and decimal place for the percentage field

In this way, we understand how to set the length and decimal place for the percentage field type in Salesforce Lightning. Let’s Proceed further and learn how to set the length and decimal place for the percentage field type in Salesforce Classic.

How to set the length and decimal place for the percentage field in Salesforce Classic

Here we will learn how to set the length and decimal place for the percentage field in Salesforce Classic. Let us take an example to clearly understand the scenario.

Here we are working with the custom object called project in Salesforce or we can select any of the objects we want in which we can create a custom field here we are creating the project completion percentage custom field and setting the length and decimal place for this percentage field.

This project completion percentage custom field represents the progress of individual tasks within a project.

For tracking the progress of the individual tasks within the project we need to set the length and the decimal place.

Here are the following steps:

1. When we login into the Salesforce account, our Salesforce Lightning account opens but we wanted to work on the Salesforce Classic account so for moved to the Salesforce Classic account. For this click on the profile picture, under this profile picture, there is an option to switch to a Salesforce classic account.

2. Click on the switch to a Salesforce Classic, Our Salesforce Classic org is open. Under this Salesforce Classic org, we can see that the username is present. Click on the drop-down arrow of the username.

3. The drop-down list is open, after clicking on the drop-down arrow. Under this drop-down list, we can see that the Setup option is present. Select the Setup option.

4. The setup page is open. Under this setup page, we can see on the left side there is Quick Find box is present. Enter the objects in the Quick Find box, the objects come at the top and it is present at the create option.

How to set the length and decimal place for the percentage field in Salesforce Classic

5. Select the object, and our custom object page will open here we can see the lots of objects present that are created by us and here we want to select the project object. Click on the project object.

Set the length and decimal place for the percentage field in Salesforce Classic

6. Our custom object project page is open and we can see the details related to the project object. Now scroll to the bottom of the page and here we can see the custom field section and under this section, we can see some fields present that are already created by us.

7. Now this time I want to create a new custom field, To create the new custom field we click on the new button.

8. After clicking on the new button, the data type page is open. Under this page lots of datatypes are present. Here we are selecting the percentage data type, scroll to the bottom of the page.

9. Percentage data type is present, Click on the percentage checkbox and then click on the next button.

Salesforce Classic set the length and decimal place for the percentage field

10. Now enter the details related to the new custom field here first enter the field label as Project completion and then set the length and the decimal place the length is the number of digits to the left of the decimal point and the decimal place is the number of the digits to the right of the decimal point.

11. After that enter the field name which is automatically filled and then click on the next button.

How to set the length and decimal place for percentage field in Salesforce Classic

12. Now establish the field level security, select the profile to which we want to grant the edit access to this field via a field level security. The field will be hidden from all the profiles if we do not add it to field level security then check the visible checkbox for the profiles that are added to the field level security and then click on the next button.

Set the length and decimal place for percentage field in Salesforce Classic

13. Here we are adding the custom field to the page layout, select the page layouts that should involve this field. The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if we do not select a layout.

13. For changing the location of this field on the page, we will need to customize the page layout. After that click on the save button.

Salesforce Classic set the length and decimal place for percentage field in Salesforce Classic

14. Our Project completion percentage field is created and we come back to our fields and relationships page under this page we can see that the project completion with a percentage field with 5 lengths and 2 decimal places is shown.

How to set length and decimal place for the percentage field in Salesforce Classic

15. Click on the Home tab, the home page is open and under this home page, there are lots of objects present on the nav bar. Here we are selecting the project object, the project record page is open and here we are creating the new record. Click on the new button.

16. After clicking on the new button the new project page opens and here we are filling in the information related to the project. First fill the project USA name and then fill the project status and after that fill the project documentation URL and after that fill the project start time and then fill the project completion field and then click on the save button.

Set length and decimal place for the percentage field in Salesforce Classic

17. After filling the project completion value, we move to the project salesforce task record page and under this page we can see that the project completion field is shown as a percentage field.

Salesforce Classic set length and decimal place for the percentage field

So with this, we understand how to set the length and decimal place for the percentage field in Salesforce Classic.

Conclusion:

The percentage field permits the user to input and store values as the percentage. The percentage field is mainly used to represent proportion and ratio in various objects.

I hope you read the complete article and get the complete idea related to how to set the length and decimal place for the percentage field in Salesforce.  I have also explained all the steps of setting the length and decimal place for the percentage field in Salesforce Lightning and Salesforce Classic.

You may like to read: