How to Set Length and Decimal Place for the Number field in Salesforce

In this Salesforce tutorial, we will learn how to set the length and decimal place for the number 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 number field in Salesforce Lightning

Here we will learn how to set the length and decimal place for the number field in Salesforce Lightning, Let’s take a real-life example to easily under the topic. There is a sales company based in America and I am working in the Finance department here we are customizing a salesforce object for tracking the financial data for this company.

We want to create a new custom field that stores the total revenue for the sales opportunity. In this case, we want the field to represent currency values with a specific length and decimal places.

For example, if we set the length to 10 and the decimal to 2 the field will allow a number like 23456789.10. This example demonstrates to us how to set the length and decimal place for the number field in the situation of tracking financial data in the Salesforce opportunity object.

Here are the following steps:

1. Go to the Salesforce lighting account and then click on the setup option that is present under the gear icon. After that select the object manager tab that is present under the setup page on the nav bar.

2. The object manager page is open, there are lots of objects present and we want to select the opportunity object so enter the opportunity in the search box and then select the opportunity object.

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

3. Under this opportunity page, we can see the details related to the object. On the left side of the opportunity object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

4. After clicking on the Field and Relationship option of the opportunity object, the opportunity 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.

5. The data type page is open. Under this page lots of datatypes are present. Here we select the number data type, scroll to the bottom of the page, and click on the next button.

6. Now enter the details related to the new custom field here first enter the field label as Total Revenue 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.

7. Now enter the field name which is automatically filled and then click on the next button.

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

8. 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.

See also  How to add Picklist Values in Salesforce

9. 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 the number field in Salesforce Lightning

10.  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.

11. The field will not appear on any pages if we do not select a layout. To change the location of this field on the page, we will need to customize the page layout. After that click on the save button.

Salesforce set the length and decimal place for the number field

12. Our Total Revenue Number field is created and we come back to our fields and relationships page under this page we can see that the Total Revenue with a number field with 10 lengths and 2 decimal places is shown.

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

13. 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 opportunity object, The opportunity 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 opportunity record page.

17. The new opportunity dialogue box is open. Now fill in the complete information related to the opportunity. First, fill in the opportunity name and then fill the lead source after that fill in the amount and expected revenue and then fill the total revenue and then click on save button.

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

18. After saving the record, the record is present under the opportunity record page. Click on the Salesforce opportunity record, and the Sales Opportunity record page will open under this page.

19. We can see the details related to the Sales opportunity when we click on the detail option, and under this detail page, we can see the total revenue field which is a number field type. Inside this total revenue field number represents the length and decimal place.

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

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

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

Here we will learn how to set the length and decimal place for the number field in Salesforce Classic. Let us take an example to clear this scenario, we take an example related to tracking the project duration in salesforce.

See also  Salesforce Geolocation Field

Suppose we have a custom object called project that manages the project details and we want to create a field that can store the estimated duration of every project that is created by the project team. Here we are setting the length of the project duration as 5 and the decimal place as 2 and the field will permit values like 899.00.

Here are the following steps:

1. Login to the Salesforce classic version, when we log in our lightning version is open. But we want to work on the classic version, so for this, we click on the profile picture and under this profile picture there is an option present switch to Salesforce Classic. Click on this to switch to the Salesforce classic version.

2. Our Salesforce classic version is open, Click on the drop-down arrow of the username. 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.

3. 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 number field in Salesforce Classic

4. 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.

5. On this page 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. The data type page is open.

8. Under this page lots of datatypes are present. Here we are selecting the number data type, scroll to the bottom of the page under this page we can see the save button is present. Click on the save button.

9. Now enter the details related to the new custom field here first enter the field label as Estimated Duration.

10 After that 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 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.

Set the length and decimal place for the number 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.

See also  Salesforce Encrypted Field

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.

14. The field will not appear on any pages if we do not select a layout. To change the location of this field on the page, we will need to customize the page layout. After that click on the save button.

15. Our Estimated Duration field is created and we come back to our fields and relationships page under this page we can see that the Estimated Duration with a number field with 5 lengths and 2 decimal places is shown.

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

16. 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.

17. 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 after that fill the project start time and then fill the project completion field and then fill the estimated duration and click on the save button.

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

18. After filling the estimated duration value as 30 days, we move to the Salesforce Project record page and under this page we can see that the estimated duration field is shown as a number field. Inside this estimated revenue field number represents the length and decimal place.

Salesforce Classic set length and decimal place for the number field

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

Conclusion:

The Number permits the users to enter any number and the leading zeroes are removed from the numbers.

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

You may like to read: