How to display only part of a decimal number
Hi,
If there is a decimal number & i want to display only the complete part ie. left part of the point then how can i do the same?
Vb.net platform
Let me explain this.
In maths 25.49 = 25 and 25.51 = 26
But i don't want this way to get the result
I want to display only the number 25 no matter what comes after decimal point.
Re: How to display only part of a decimal number
this is the way you can get the desired result!
number = cint(int(12.51))
Thanks!
Re: How to display only part of a decimal number
First you have to convert from String to a number, then cut the
decimal places, then convert to Integer. Conversion from String to
number is culture dependent (usually "." or "," as decimal separator).
Dim number As Integer
number = cint(math.floor(cdec(TextBox1.Text)))
msgbox (number)