Round double in two decimal places in C#?

后端 未结 8 2146
忘掉有多难
忘掉有多难 2020-11-30 18:21

I want to round up double value in two decimal places in c# how can i do that?

double inputValue = 48.485;

after round up

i         


        
8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 18:49

    I think all these answers are missing the question. The problem was to "Round UP", not just "Round". It is my understanding that Round Up means that ANY fractional value about a whole digit rounds up to the next WHOLE digit. ie: 48.0000000 = 48 but 25.00001 = 26. Is this not the definition of rounding up? (or have my past 60 years in accounting been misplaced?

提交回复
热议问题