In Number, Currency, and Percent fields, entering a value with more decimal places than configured in the field definition results in the system automatically rounding and saving the value by default. This article explains how to prevent input values from being modified unintendedly by using the MOD function in a Validation Rule. This setup displays an error message when an input exceeds the specified number of decimal places.
The logic used in the Validation Rule formula is to "shift the decimal point to the right (by multiplying), and if a decimal value still remains (the remainder when divided by 1 is not 0), trigger an error."
【Example】 Limiting input to 2 decimal places
To evaluate the value, multiply the number by 100 to shift the decimal point two places to the right.
【Formula Configuration】
Configure the actual formula as follows:
For Percent Fields Percent fields are stored in the database as a value divided by 100 (e.g., 10% is stored as 0.1). Therefore, in addition to the visible decimal places on the screen, you must account for the digits used for the percentage conversion.
(Example) To limit to "2 decimal places" as displayed on the screen:
MOD( FieldName__c * 10000, 1 ) <> 0
Note: Replace FieldName__c with the API Name of your Percent field. You need to shift by a total of 4 digits: the "2 decimal places" visible on the screen plus the "invisible 2 digits" (due to the /100 storage specification). Therefore, multiply by 10,000 (four zeros).
005132292

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.