超过大约 13 个小数位的长十进制字符串在浏览器中交互时会失去精度并被舍入。浏览器以不同的方式处理这种数字精度的损失,导致小数点舍入的变化。这是 Web 浏览器中 Javascript 数字对象的一个限制。
这种 Javascript 行为可以在 Salesforce 之外的浏览器中直接看到。例如,在 Chrome 中:
当在数字字段中输入值时,在开发人员控制台中也可以看到这种舍入。
这种行为是由 Javascript 处理数字的方式造成的,不是 Salesforce 可以控制的。如果通过 API 输入冗长的十进制字符串,通过 UI 与这些字段交互的用户可能会遇到 Javascript 舍入行为。通过 UI 保存这样的记录会将舍入值引入数据库。如果有任何 Salesforce 验证要求不更改数据库值,此舍入将被视为更改并触发验证。
可以通过 API,以比字段允许的最大小数位数更高的精度保存数字。有关更多信息,请参见数据类型数字字段可以存储比定义的更多的小数位数。
000394530

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.