Luke McGrath

Luke McGrath

  • NA
  • 1
  • 2.7k

round up or down the value that is in a text box, depending on the value

Mar 21 2011 8:46 PM
hi all,

im currently creating a program that will calculate averages of 3 different numbers which, when calculated the answer is ouputted to a text box, what i need and cannot get is that obviously averaging by 3 you will get a decimal answer eg 1.6 etc, what i need to calculate or do is that if the textbox value = 0.6 and less it equals 0 then also if textbox value = greater than 0.7 but less than 1.6 then that will equal 1, then in turn > 1.7 < 2.6 = 2 and >2.7 <3.6 = 3 and >3.7 < 4.6 = 4 and lastly > 4.7 <5.6 = 5

ive tried using math.ceiling and floor but do not know how to round up and round down depending on those particular values

can any one please shed some light on this issue as its very urgent!

Thanks in advance

Luke :)

Answers (2)