Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 30-01-2009
Member
 
Join Date: Aug 2008
Posts: 145
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.
Reply With Quote
  #2  
Old 31-01-2009
Member
 
Join Date: May 2008
Posts: 115
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!
Reply With Quote
  #3  
Old 31-01-2009
Member
 
Join Date: May 2008
Posts: 40
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)
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to display only part of a decimal number"
Thread Thread Starter Forum Replies Last Post
Getting error "Your entry cannot be used. An integer or decimal number may be req" in Excel Ankit Zh@very MS Office Support 2 24-01-2012 01:06 PM
how to increase the number of decimal digits in JAVA program output? Dennis Racket Software Development 2 19-01-2012 02:38 PM
How to convert a decimal number into words in Excel using VBA? Gandhik Windows Software 3 27-11-2010 12:59 AM
How to display decimal numbers in Excel sheet Halina Windows Software 3 05-05-2009 03:13 PM
Help creating 2 part page number dfeder Windows Software 3 12-11-2008 12:14 PM


All times are GMT +5.5. The time now is 07:11 AM.