function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SF Buzz VutukuriSF Buzz Vutukuri 

percentage caluculation

HI please help me caluculate percentage between 2 number in apex

for exampple

decimal a=2; decimal b=10;
how to caluculate percentage for this number ??? (2/10)*100.

math.mod() is not supporting decimal values ................ If we take integer values then we wont get correct result

 

sandeep sankhlasandeep sankhla
HI SF,
The way  you have mentioned in same way you can calculate this...

Decimal C =( Decimal A / Decimal B)*100
SF Buzz VutukuriSF Buzz Vutukuri
no bro I ain't gettin crct output wen i do like that Thanks Regards Bhaswanthnaga vivek Vutukuri
sandeep sankhlasandeep sankhla
I have used long back and it was giving correct output for me..I used apex side adn it was good..for this it will give 20..what should be the output and what you are getting ?
 
SF Buzz VutukuriSF Buzz Vutukuri
I am getting output 0 Thanks Regards Bhaswanthnaga vivek Vutukuri