+ 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