-2

Im trying to get 75% of the CTotal but as it is a decimal number it is rounding 0.75 to 0, does anyone know of a work around

        decimal refundtot = order.CTotal;
                //change it as it is making it = 0 


                refundtot = (75 / 100) * refundtot;
                refund.RefundTotal = refundtot;

1 Answers1

1

You should use one decimal number when you dividing numbers.

Your code should look like this :

efundtot = ((decimal)75 / 100) * refundtot;
Bob Swager
  • 884
  • 9
  • 25