i have number 1 5. how find first 3 number in range ?
for example, in range of 1 5, result show number 1, 2 , 3 in textbox.
thanks tim schmelter , justin ryan comment previous code. manage find first 3 numbers. but, when put them in texbox, become more messy . how show in 3 textbox ?
the result second code write textbox , first 3 values are: 26.75 24.08 18.22 .. without spacing. but, first 3 value correct. how extract value 26.75 in textbox1, 24.08 in textbox 2 , 18.22 in textbox 3 ?
here second code :
dim baa3 decimal = 0 dim bbb3 decimal = 0 dim bcc3 decimal = 0 dim bdd3 decimal = 0 dim bee3 decimal = 0 baa3 = convert.todecimal(datagridview1.rows(4 - 2).cells(4).value) bbb3 = convert.todecimal(datagridview1.rows(52 - 2).cells(4).value) bcc3 = convert.todecimal(datagridview1.rows(100 - 2).cells(4).value) bdd3 = convert.todecimal(datagridview1.rows(148 - 2).cells(4).value) bee3 = convert.todecimal(datagridview1.rows(196 - 2).cells(4).value) ' create list of long values. dim longs3 new list(of double)(new double() _ {baa3, bbb3, bcc3, bdd3, bee3}) ' first 3 values. dim topthreegrades ienumerable(of double) = _ longs3 _ .orderbydescending(function(grade) grade) _ .take(3) ' display results. dim output new system.text.stringbuilder("the first 3 values are:" & vbcrlf) each grade double in topthreegrades output.appendline(grade) next textbox1.text = output.tostring() textbox2.text = output.tostring() textbox3.text = output.tostring()
Comments
Post a Comment