Results 1 to 3 of 3

Thread: How to display only part of a decimal number

  1. #1
    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.

  2. #2
    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!

  3. #3
    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)

Similar Threads

  1. Replies: 2
    Last Post: 24-01-2012, 01:06 PM
  2. how to increase the number of decimal digits in JAVA program output?
    By Dennis Racket in forum Software Development
    Replies: 2
    Last Post: 19-01-2012, 02:38 PM
  3. Replies: 3
    Last Post: 27-11-2010, 12:59 AM
  4. How to display decimal numbers in Excel sheet
    By Halina in forum Windows Software
    Replies: 3
    Last Post: 05-05-2009, 03:13 PM
  5. Help creating 2 part page number
    By dfeder in forum Windows Software
    Replies: 3
    Last Post: 12-11-2008, 12:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,049,645.36052 seconds with 16 queries