hi....
i have 3 textbox in my form.in a very simple form ,i want textbox3 calculate the multiply of textbox1 value in textbox2 value.
it's result in calculator is : 1524156776377086.7
but if in Textbox1.TextChange And Textbox2.TextChange event put this code :
or by this code :
why this happen and what should i do so my result equal by calculator's result.
i have 3 textbox in my form.in a very simple form ,i want textbox3 calculate the multiply of textbox1 value in textbox2 value.
VB.NET:
Textbox1.text=1234567890.1
Textbox2.text=1234567
it's result in calculator is : 1524156776377086.7
but if in Textbox1.TextChange And Textbox2.TextChange event put this code :
VB.NET:
Textbox3.text=val(textbox1.text) * val(textbox2.text)
the result is : 1.52415677637709E+15
or by this code :
VB.NET:
textbox3.text=FormatNumber([FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][SIZE=2][FONT=Consolas][COLOR=#0000ff]CType[/COLOR](Val(TextBox1.Text), [COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]Double[/COLOR][/COLOR][/COLOR]) * [COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]CType[/COLOR][/COLOR][/COLOR](Val(TextBox2.Text), [COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]Double[/COLOR][/COLOR][/COLOR]), 5, , , )[/FONT][/SIZE]
[/SIZE][/FONT][/SIZE][/FONT]Result is : 1524156776377090.00000
why this happen and what should i do so my result equal by calculator's result.