237.631 in the standard UI edit page, Salesforce will display 237.6 after saving (rounded to 1 decimal place). However, the value 237.631 is stored in the database. If you then set the same value via API (for example, via a SOQL query or Apex), 237.631 is both stored in the database and returned by the API without rounding.This is expected behavior and is maintained for backward compatibility in Salesforce.
The length and decimal places defined on a Number field are only enforced when editing data via the standard Salesforce web UI. When a user enters a value more precise than the field definition, Salesforce rounds and displays the value according to the field definition — but stores the full precision value in the database.
Apex and API methods can save records with decimal places beyond the field definition. Salesforce changes the display to match the field definition, but the full precision value is stored in the database as inserted. When you retrieve the value via API, no rounding occurs.
In Lightning Experience, custom objects store more decimal places than the default number set for the field. For example, if you enter 90.678 on a field that accepts 2 decimal places, the record form displays 90.68, but inline edit shows the original 90.678, and 90.678 is stored in the database.
In Salesforce Classic, the value 90.678 on a 2-decimal-place field is saved as 90.68 in the database.
The precision of Number values managed through the UI or SObject API is limited by the precision of the Java Double type. For example, entering 49.999999999999972 into a Number field on the UI will result in 49.99999999999997 being stored in the database.
Reference Link: Primitive Data Types
000387302

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.