When you query a custom number field through the Salesforce API, large values may be returned in scientific notation instead of the plain number shown in the Salesforce UI.
When querying large value custom number fields through the API, you will notice the values are returned with scientific notation. This is not just through SOAP API, but Rest API or SOQL as well.
For example if you see value 1234567 through the UI, when querying through API - you will see 1234567.0
However if you see value 12345678 through the UI, when querying through the API - you will see 1.2345678E7
When the custom number field has values up to 7 digits (such as 1234567), the API values returned are normal(1234567.0). But for custom number field with digits 8 - 14 (such as 12345678), API values returned will be exponential values (1.2345678E7).
This is actually Working as Design.
Custom Number fields are stored as Double values in our database. Large values are stored in scientific notation as that stated in XML standards. Due to this, our queries return scientific values rather than plain numbers.
Review the SOAP API Developer Guide - DescribeSObjectResult for further information on the below details of scale and precision.
Double values: Fields of this type can contain fractional portions (digits to the right of the decimal place),such as ConversionRate in CurrencyType. In the API, all non-integer values (such as Currency Field double Type and Percent Field Type) contain values of type double. Some restrictions may be applied to double
values:
• scale: Maximum number of digits to the right of the decimal place.
• precision: Total number of digits, including those to the left and the right of the decimal place
The maximum number of digits to the left of the decimal place is equal to precision minus scale. In the online application, precision is defined differently—it is the maximum number of digits allowed to the left of the decimal place.
Values can be stored in scientific notation if the number is large enough (or, for negative numbers, small enough), as indicated by the W3C XML Schema Part 2: Datatypes Second Edition specification:
3.2.5.1 Lexical representation
Double values have a lexical representation consisting of a mantissa followed, optionally, by the character "E" or "e", followed by an exponent. The exponent ·must· be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the lexical rules for integer and decimal. If the "E" or "e" and the following exponent are omitted, an exponent value of 0 is assumed. The special values positive and negative infinity and not-a-number have lexical representations INF, -INF and NaN, respectively. Lexical representations for zero may take a positive or negative sign. For example, -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF are all legal literals for double.
There is an existing Salesforce Idea on this request. Please review apex dataloader: I want to stop exponential notation.
Voting for this idea will help to change the current behavior and not follow the XML standard, but to follow the customer expectation of the API returned value reflecting the value displayed in the UI.
000385889

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.