1

I have percent field per. I am using this field in apex coding for calculation purpose.

My formula in code is:

Field_A__c = Field_B__c * Percent__c

Suppose Percent__c = 75 (i.e 75%) and Field_B__c = 35. In that case, Field_A__c should be 35 * 0.75 = 26.25. But it is actually doing 35 * 75 = 2625.

What can we do here?

1
  • Related post
    – Raul
    Feb 10, 2017 at 10:35

1 Answer 1

3

Just divide by 100.

35 * 75 / 100 = 26.25

So use a formula of

Field_B__c * Percent__c / 100
1
  • thats perfect. Thank you. This is the matter of logic. Feb 10, 2017 at 10:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .