The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
24 views

How to divide Oppo RSF field on Oppo Products into equal amounts based on # of Oppo Products

In opportunity line item/product we have custom field called break up fee ...which will filled if the opportunity is closed lost. In oppy we have a roll up field will calculate the sum of all break ...
3
votes
1answer
96 views

Do we have RADIANS math function in Salesforce?

i am trying to find nearest stores and their longitude and latitude based on customer location (lon,lat) and populate in Google map. Here is a sample query would work in MySQL. Would this same query ...
0
votes
1answer
141 views

Ceiling Decimal in apex

I want to get the nearest ceiling for the decimal value. For 1268.0 => I want to get 1300. For 2537.0 => I want to get 2500. It would be like Excel function. I used ...
3
votes
2answers
576 views

What makes a field not groupable

I'm trying to use an aggregate query, but one of the fields I want to group by is not groupable (saw it in the soql error and then verified groupable=false in the metadata). It's just a number field ...
8
votes
2answers
479 views

Comparing floating-point values

In Apex, can Decimals be compared directly. For example: dec1 > dec2 or dec1 == dec2 In other languages I sometimes run into issues with fractions such that 1/3 and 0.33 are not going to be equal. ...
11
votes
1answer
319 views

Is there an average method for apex math

I was doing some bill calculations, and went looking in the math method for an average. Usage would be something like math.average(1, 4, 6, 7, 8, 9) math.average(ListOfIntegers) ...
8
votes
1answer
6k views

Round a Decimal to two decimal places

How can I round an arbitrary Decimal to 2 decimal places (hundredths of a dollar)? My first thought was to use the Math Functions ROUND(number, numDigits): Decimal toRound = 3.14159265359; ...
11
votes
8answers
5k views

What is a concise function that formats a (String) decimal into a currency format in Apex?

goal: write the most concise function that formats a (String) decimal into a currency format in Apex. Feel free to trainwreck the code for points, I've kept mine exploded for readability purposes.