i have a requirement like this,in my working project,

for (Sobject aggregrate: aggregratecountList) {
            totalCount = Integer.valueOf(aggregrate.get('ID'));
percent = decimalaggregate.Divide(totalCount, 2);

the percentage is showing as 50: instead of 100,

closed as unclear what you're asking by cropredy, Vigneshwaran G, Himanshu, Sebastian Kessel, Ratan Paul Apr 25 '16 at 14:06

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • pls suggest me how to do it'' – Satya Apr 25 '16 at 11:06
  • how to calculate the percentage of total records using id. – Satya Apr 25 '16 at 11:06
  • 2
    It is not quite clear to me what you're asking. The subject mentions 'count of ids', one of your comments mentions 'percentage' and your code divides by 2. I would suggest editing your own question to indicate what your requirements are, what you've tried, and what doesn't work. That's the best way to get help from this community. – mkorman Apr 25 '16 at 11:49

you only created Divide method in decimalaggregate class and called it

   decimalaggregate.Divide(totalCount, 2).

You get some if using SOQL get their count, and get total no of records of that data type existing in the system.

then just put them in simple percentage formula.

  • yes am trying in different ways,if i put write divide also am not not getting 100:%' – Satya Apr 25 '16 at 11:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.