Visual Basic.NET - REDONDEO DECIMAL

 
Vista:

REDONDEO DECIMAL

Publicado por An tonio (4 intervenciones) el 04/11/2010 22:52:02
Hola, como podria modificar este codigo para que el resultado del textbox6.text, redondeara a entero cuando el resultado sea decimal, es decir si es por ejemp.6,5 que sea 7 y si es 6,4 que sea 6.
gracias..


Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

TextBox6.Text = TextBox5.Text * 5.35
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:REDONDEO DECIMAL

Publicado por Smith (26 intervenciones) el 04/11/2010 23:07:03
Podrias hacer esto
TextBox6.text=format( val(Textbox5.text) * 5.35,"#,##0" )

Sino utitilizar la funcion ROUND de VStudio.

Suerte..
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:REDONDEO DECIMAL

Publicado por ANTONIO (4 intervenciones) el 04/11/2010 23:16:04
Perfecto, muchisimas gracias, funciona.¡¡¡
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:REDONDEO DECIMAL

Publicado por vicente wray (1 intervención) el 27/11/2010 12:17:59
esta es la mejor manera

CON UN DECIMAL

Label1.Text = CStr(System.Math.Round(Val(Text1.Text)))

CON DOS DECIMALES

Label1.Text = CStr(System.Math.Round(Val(Text1.Text),2))
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:REDONDEO DECIMAL

Publicado por Pepe (1 intervención) el 07/02/2011 17:11:08
CInt(La operación)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar