Skip to main content
added 24 characters in body
Source Link
Mohith Shrivastava
  • 92k
  • 19
  • 161
  • 214

Why is totals showing zero for me in this snippet?

Integer stats;

Decimal total;

Integer cntOrg=60;

stats=200; total = stats/cntOrg;

system.debug('Values for '+org+' is ' + total);

Integer stats;

Decimal total;

Integer cntOrg=60;

stats=200;
total = stats/cntOrg;

system.debug('Values for '+org+' is ' + total);

Why is totals showing zero for me in this snippet?

Integer stats;

Decimal total;

Integer cntOrg=60;

stats=200; total = stats/cntOrg;

system.debug('Values for '+org+' is ' + total);

Why is totals showing zero for me in this snippet?

Integer stats;

Decimal total;

Integer cntOrg=60;

stats=200;
total = stats/cntOrg;

system.debug('Values for '+org+' is ' + total);
Source Link
Apex N-u-b
  • 1.3k
  • 3
  • 29
  • 51

Apex division shows zero value instead of correct value

Why is totals showing zero for me in this snippet?

Integer stats;

Decimal total;

Integer cntOrg=60;

stats=200; total = stats/cntOrg;

system.debug('Values for '+org+' is ' + total);