narasiman rao

narasiman rao

  • NA
  • 519
  • 771.8k

roundoff nearest

Jul 11 2012 12:34 PM

working days in a month   textbox1   calendarimage

pay days                         textbox2

        
                                      ScaleAmt       Total Amt
otamount                         textbox3        textbox4

I WRITE THE CODE IN TEXTBOX2_TEXTCHANGED I WRITE THE BELOW CODE
 double working days in a month  = Convert.ToDouble(textbox1.Text);
            double pay days    = Convert.ToDouble(textbox2.Text);
            double a = Convert.ToDouble(textbox3 .Text);
          textbox4.Text = Convert.ToDouble((a /working days in a month ) * pay days).ToString();


in run mode

in textbox1 i choose january month 31 days will appear in the textbox1
in   textbox2 i type  25
in   textbox3   type 2720
in   textbox4  2193.54838709677(ANSWER)

but my question is answer 2193.54838709677 is correct but i want the answer roundoff that is 2194.
from the above code for roundoff how to write the code.from the above please make changes and send the new code for me it is great helpful for me also.



Regards,
RAO




Answers (3)