On Feb 13, 9:43 pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Feb 13, 7:26 pm, "Teemu" <tsir...@hotmail.comwrote:
"kimiraikkonen" <kimiraikkone...@gmail.comkirjoitti viestissänews:ab********************************** @l16g2000hsh.googlegroups.com...
Hi,
Sorry if this is so basic but i wanted to know the correct way of
displaying a value's "only" integer part.
I mean; if i declare a value as integer which is actually a decimal
number, it returns upper value after .51 decimal part.
I mean;
Dim number as integer = 12.51 returns 13.
If i;
Dim number as integer = 12.49 returns 12 as well.
I want to return only the integer part (12) in every case without
depending on whatever decimal part is.
Thanks
Math.Floor for example.
-Teemu
Thanks all. Much ways there were.
As last, i'd like to know how get these functions work with the value
in textbox?
if i type 12.51(dot) in textbox1 and use that code;
Dim number As Integer = TextBox1.Text
MsgBox(Math.Floor(number))
i get: 1251
and if i type 12,51 (comma) in textbox1 and use that code;
Dim number As Integer = TextBox1.Text
MsgBox(Math.Floor(number))
i get: 13 instead of 12
Behaviour is same also with FIX function...
Thanks!