Questions tagged [double]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
124 views

Are constants for NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY available in Apex logic for Double?

Based on this java.lang.Double source code I tried to get these constants to use in an Apex port of a Java open source algorithm: private static final Double DOUBLE_NEGATIVE_INFINITY = Double.valueOf(-...
Keith C's user avatar
  • 134k
0 votes
1 answer
136 views

Prevent the double lightning header while navigation to Lightning Web Component

I have a Lightning web component which doesn't fit in the half-sized modal popup screen but I need to open it from the action on the record page. I have found an interesting idea about how this can be ...
Patlatus's user avatar
  • 15.8k
1 vote
1 answer
2k views

Round Double to three Decimal places

Dear all I am trying to round a Double number with three decimal places: Double tl = (tReadTotal/totalRead).setScale(3); c.CAC_Lectura__c = tl; Doing this it does not work, How can I do that??
Mar Andrés López's user avatar
2 votes
1 answer
8k views

Invalid conversion from runtime type String to Double

Background I am getting this error: Invalid conversion from runtime type String to Double On this line of code: line.put(targetField, (Double)fieldValue); The variable fieldValue is of type ...
Robs's user avatar
  • 9,047
0 votes
1 answer
1k views

Is Scientific notation allowed in double

Apex document clearly says, Scientific notation (e) for Doubles is not supported. But again, Salesforce Object Reference guide says, Values can be stored in scientific notation if the number is large ...
Azeez's user avatar
  • 101
1 vote
1 answer
2k views

Convert double to String

I have the following double from salesforce as a number = Latitude = 50.916408140415314 I want to convert it to a string. However when I convert it to a string like this: string.valueof(latitude) i ...
ChristianJuul's user avatar
17 votes
3 answers
20k views

Decimal or double?

What datatype should I use in Apex Classes when I need to store a number with decimal places. What do you use and why?
Jovabe's user avatar
  • 717
0 votes
3 answers
1k views

round a value to .0 or .5

I'm looking for a way to round a value to .0 or to .5, so 1,34 would become 1.5, 1.22 would become 1.0, 1.63 would become 1.5, and 1.79 would become 2.0. Is there a function to accomplish ...
Thomas's user avatar
  • 71
3 votes
1 answer
876 views

Salesforce API query encountering error with large integer / double

I'm having an issue querying the Salesforce API with a number larger than the max for a 32-bit integer. I don't think it's code-based as the problem is also encountered when using the Salesforce ...
user3365989's user avatar
11 votes
1 answer
3k views

Converting between .NET decimal and SFDC decimal

We have a .NET app that interfaces with SFDC via a web service. When we import the WSDL the resulting classes will use the .NET type double wherever SFDC entities use a double. The problem I see here ...
Paul Sasik's user avatar
  • 1,109
7 votes
1 answer
3k views

What is max and min range for double.valueOf()?

what is max and min range for double.valueOf() in apex.
Ugesh Gali's user avatar