In this Salesforce tutorial, we will learn how to convert the text to number field type in Salesforce. The text field is a type of field that permits the user to enter any type of combination of letters, and symbols and here we convert this text field to a number. The number field permits the users to enter any numbers.
Let’s take an example to easily understand the scenario, There is a company that uses Salesforce for managing Sales opportunities. The company has a custom object that is created by the team and the custom object name is Opportunity This opportunity object contains various fields including with estimated revenue text field.
There are Sales representatives who enter the estimated revenue for each opportunity as text Like $2000, or $3500 but at that time the company wanted to convert this estimated revenue text field into a number field this number field performs accurate calculations and reports accurately.
If you want to learn the process of how to convert the text to number field type in Salesforce you have come to the right place and we learn this topic in both the editions in Salesforce Lightning and Salesforce Classic.
How to convert the text to number field type in Salesforce Lightning
Here we will learn how to convert the text to a number field type in Salesforce Lightning. For example, the University of the United States of America uses Salesforce to manage student records, and the university also includes a custom object for course enrollment.
This object contains custom text fields, and inside lots of fields, there is a grade text field where the instructor enters the student grades as a text value like A, A+, B, B+, etc. But now the university wants to convert the grade text field into a number field to perform the CGPA calculations and for this, they can easily generate reports.
If you want to learn how to convert the text to a number field type in Salesforce Lightning, follow these steps:
Step-1: The user logs into the Salesforce account by simply using their credentials, The user enters the credentials and the Salesforce account is open, they directly come into the Salesforce Lightning account.
In this Salesforce Lightning org, we convert the text to number field type for this, We can click on the gear icon that is present at the top right corner, and under this gear icon, there are two options. The first one is Setup and the other one is service setup. Click on the Setup option, after clicking on the Setup option.

Step-2: After clicking on the setup option the setup page is open, Under this Setup page we can see that the two tabs are present on the nav bar. The First tab is a Home tab and the other tab is the Object Manager tab, under the object manager tab lots of objects are present. So, Click on the Object Manager tab.

Step-3:
- After clicking on the Object Manager tab, The Object Manager page opens. Under this object manager tab, lots of objects are present.
- Select one of the objects from the lots of objects If the object is not shown you want to choose to enter the object name in the search box and this search box is present at the top right corner of the page. And here we are entering the Course Enrollment in the search box.
- The Course Enrollment object is already present at the first number, if the object is not present at the top after searching the object comes at the top we search in the search box, and select the course enrollment object from the object manager page.

Step-4: After clicking on the Corse Enrollment object, the course enrollment object page is open and under this page, we can see the details related to the object. And on the left side of the course enrollment object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

Step-5: After clicking on the Fields and Relationships option, the Fields and Relationships page is open. Inside this page, we can see that lots of fields are present, here we are selecting the text field as a grade. Click on the grade text field.

Step-6: After clicking on the grade text field type, the course enrollment custom field grade page is open. Under this page we can see the detail related to the grade field is present and we want to edit this detail, so click on the edit button that is present at the middle of the page.

Step-7:
- After editing the grade custom field, the edit course enrollment custom field grade page is open. Under this page, we can see that the information field related to grade is present.
- This grade is the text field type but we want to convert this text field type to a number field type to perform the CGPA calculations and for this, they can easily generate reports.
- For changing the field click on the change field type button that is present at the middle of the grade custom field page.

Step-8: After clicking on the change field type button, the data type page is open. Here we can see that the text field type is already selected which allows the users to enter any combination of letters and numbers, but we want to convert this text field to a number field.

Step-9: After clicking on the number field type, the pop-up message comes up as we can see at the top of the page. The message is Changing to the selected datatype will cause you to lose all the existing data in this field, Read the message carefully and click on the ok button.

Step-10: After clicking on the OK button our text field type is converted to a number field type that allows the users to enter any number, leading zeros are removed, and then click on the next button.

Step-11: The Grade page is again open, we can enter the details related to the custom field grade and here we can enter the length of the number and the number of decimal places like a number with a length of 8 and 2 decimal places can accept values up to 12345678.90 and then click on the save button.

Step-12: After clicking on the save button, our grade text field is converted to number field successfully and seen under the field and relationships page.

Step-13: Go to to the App Launcher, and enter the Course Enrollment object in the search box. The course enrollment object comes at the top. Click on the course enrollment, the course enrollment page is open. We can see there is no record present on this page.
To create the new record click on the new button, and the new course enrollment dialogue box opens. Enter the complete information related to the course enrollment, First, fill the course enrollment name here fill the computer course and then enter the grade as 8, and then click on the save button.

Step-14: After clicking on the save button, the computer course record page is open, We can see the details related to the computer course and we can see that our grade field is converted it into the number field.

In this way, we understand how to convert the text to number field type in Salesforce Lightning. Let’s Proceed further and learn how to convert the text to number field type in Salesforce Classic.
How to convert the text to number field type in Salesforce Classic
Here we will learn how to convert the text to number field type in Salesforce Classic. Let us take an example from which we can easily understand things, There is a retail company that uses Salesforce to manage its product index this product index contains the product custom object.
Within the custom object product, they have a price custom text field where we can store the product price as a text value like $55. The retail company wants to convert this price text field to number field to calculate the accurate price.
If you want to learn how to convert the text to number field type in Salesforce Classic, follow these steps:
Step-1: When we log into our Salesforce account, the Salesforce Lightning version is open, but we want to work on the Salesforce Classic, for switching to the Salesforce Lightning to Salesforce Classic.
Click on the profile picture that is shown in the right top corner. The Profile picture drop-down menu is open, under this drop-down menu, there is an option to switch to the Salesforce Classic version. Click on the switch to the Salesforce Classic version. Our Salesforce Classic org is open.
Under this classic org, we can see that the username is present at the top of the page. Click on the drop-down arrow of the username. After clicking on the drop-down arrow the drop-down list is open. Under this drop-down list, we can see that the Setup option is present. Select the Setup option.

Step-2: After clicking on the Setup option, The Setup page is open. Now scroll to the bottom of the page, On the left side we can see that there is a Quick Find Box, Enter the Product object. The products object comes at the top, click on the drop-down arrow of the products object. Under this drop-down list, there are field options. Click on the Fields.

Step-3: After clicking on the product object, The product page opens. Now scroll to the bottom of the product page, There are Product custom fields and a relationship section present.
Under this product custom fields and relationships section, there are lots of fields present but we want to select the text field and here we are selecting the price text field type. Click on the edit button.

Step-4: After editing the price custom field, the edit product custom field price page is open. Under this page, we can see that the information field related to price is present. This price is the text field type but we want to convert this text field type to a number field type to calculate the accurate price and for this, they can easily generate reports.

Step-5: After clicking on the change field type button, the data type page is open. Here we can see that the text field type is already selected which allows the users to enter any combination of letters and numbers, but we want to convert this text field to a number field.

Step-6: After clicking on the number field type, the pop-up message comes up as we can see at the top of the page. The message is Changing to the selected datatype will cause you to lose all the existing data in this field, Read the message carefully and click on the ok button.

Step-7: After clicking on the OK button our text field type is successfully converted to a number field type that allows the users to enter any number, leading zeros are removed, and then click on the next button.

Step-8: The Edit Product Custom Field Price page is again open, We can enter the details related to the custom field price.
Here we can enter the length of the number and the number of decimal places like a number with a length of 8 and 2 decimal places can accept values up to 12345678.90 Here we are putting the length as 18 and in decimal place we put 0 value and then click on the save button.

Step-9: After clicking on the save button, again go to the home page, For this click on the home tab, and the home tab will open. Here we can see that lots of objects are present on the nav bar and from all these objects we want to select the product object. So click on the product object.
After clicking on the product object the product object page is open. Here we can see that lots of records are already created For creating a new record click on the new button that is present at the middle of the page.
The Product Edit new product page is open, We can enter the product details and mark the products as archives if we want them to be added to price books or opportunities. Now enter the product name, product code, serial number, and price this price number field is used to calculate the accurate price. Click on the save button.

Step-10: After saving the information, we can see that the product desk record is created successfully and shown under the detail. Here we can see that the product name, quality, serial number, and price are shown. We can also edit, delete, and clone this record.

So, with this, we have learned how to convert the text to number field type in Salesforce Classic.
Conclusion:
In this complete blog, we learned to convert text to numbers, We simply choose the object and select the text field that is present under the object, We convert the text field to number field type for this we click on the change field type button and convert the field type text to number and our text field type is converted into the number.
I hope you read the complete article and get the complete idea related to how to convert the text to number field type in Salesforce. I have also explained all the steps of making the text field type unique in Salesforce Lightning and Salesforce Classic.
You may like to read
- Unique Text Field Type in Salesforce
- Salesforce Case Sensitivity For Text Field Type
- How to Set Default Value For Text Field in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.