visual studio 2017 - C# Math.Ceiling is not working like what I have read and researched. Windows Forms App -
so should quick , easy fix me with. have made need round number going come out float possibly @ points round nearest integer. code have far.
int result = ci * di; double result1 = result * 0.10; if (result1 == result1) math.ceiling((double)result1); if (result1 >= 1000) result1 = 1000;
when run program goes through without errors fails want. if there way make code cleaner i'm it. topic, if type in lets 56 in 1 box , 3 in other, should come out saying have value of 16.8 due percentage calculations have done. when try math.ceiling there, doesn't round anything. also, greater or equal 1000 thing because don't want number going on 1000. thank may offer.
the function math.ceiling
not change value of double result1
returns it. variable result1
must explicitly re-assigned output of math.ceiling
function if wish take output of function. can assign this.
result1 = math.ceiling(result1);
Comments
Post a Comment