これは完全に設計どおりに動作し、下位互換性を維持できるように動作を維持しています。
長さと小数部の桁数は、標準 Web UI を使用してデータを編集する場合にのみ適用されます (カスタムオブジェクト | 新規項目 | データ型:Number | Check the fields - length and decimal places) (数値 | 項目を確認する - 長さと小数点の位置)
Apex および API メソッドでは、実際には小数点以下の桁数でレコードを保存できます。これは、標準項目でもカスタム項目でも同様です。Salesforce は定義に合わせて表示を変更しますが、それらは挿入されたとおりにデータベースに保存されます。
ユーザーが Salesforce アプリケーションのカスタム項目の精度を設定すると、それらの項目で定義された精度よりも正確な値を入力した場合でも、その項目で設定された精度が表示されます。ただし、API を使用してカスタム項目の精度を設定すると、ユーザーが数値項目を取得したときに丸めは行われません。
Lightning Experience では、カスタムオブジェクトには項目に設定されたデフォルトの小数点以下の桁数よりも多くの桁数を保存できます。小数点以下 2 桁を受け入れる項目に「90.678」を入力すると、その数値はレコードフォームでは 90.68 と表示されます。インライン編集を開始すると、項目は元の入力である 90.678 と表示されます。同様に、値はデータベースには 90.678 として格納されます。Salesforce Classic では、入力 90.678 は 90.68 としてデータベースに保存されます。
また、数値の精度は、UI または SObject API で管理されるデータの Java Double Type の精度によって制限されます。たとえば、UI の [数値] 項目に「49.999999999999972」と入力すると、49.99999999997 がデータベースに保存されます。
参照リンク:プリミティブデータ型
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.