Results 1 to 7 of 7

Thread: [RESOLVED] Decimal numbers..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    [RESOLVED] Decimal numbers..

    how to round up a decimal numbers.. 5.63 = 6.00, 5.43 = 5.00
    ________
    Montana medical marijuana dispensary
    Last edited by rothj0hn; Feb 15th, 2011 at 01:55 PM.

  2. #2
    Fanatic Member Vectris's Avatar
    Join Date
    Dec 2008
    Location
    USA
    Posts
    941

    Re: Decimal numbers..

    Do a little searching next time. Try google.

    It's really simple, just Math.Round().
    If your problem is solved, click the Thread Tools button at the top and mark your topic as Resolved!

    If someone helped you out, click the button on their post and leave them a comment to let them know they did a good job

    __________________
    My Vb.Net CodeBank Submissions:
    Microsoft Calculator Clone
    Custom TextBox Restrictions
    Get the Text inbetween HTML Tags (or two words)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: Decimal numbers..

    thanks. how about only numbers with decimal value of .00 returns it value..

    5.00 = 5.00
    5.63 = 6.00
    5.43 = 6.00

    sorry got no time in googling things.. thats why i just leave question here and try to check some answer if i have extra time.
    ________
    Journey
    Last edited by rothj0hn; Feb 15th, 2011 at 01:55 PM.

  4. #4
    Fanatic Member Vectris's Avatar
    Join Date
    Dec 2008
    Location
    USA
    Posts
    941

    Re: Decimal numbers..

    No time to google? It would have taken less than 5 minutes to find the answer to your question, and it took 17 for me to give you the answer. Just googling "vb.net round decimal number" would of returned plenty of good solutions.

    As for your next question, if the number will always end in ".00", since your rounding it, then just add it as a string using & ".00"
    If your problem is solved, click the Thread Tools button at the top and mark your topic as Resolved!

    If someone helped you out, click the button on their post and leave them a comment to let them know they did a good job

    __________________
    My Vb.Net CodeBank Submissions:
    Microsoft Calculator Clone
    Custom TextBox Restrictions
    Get the Text inbetween HTML Tags (or two words)

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: Decimal numbers..

    As for your next question, if the number will always end in ".00", since your rounding it, then just add it as a string using & ".00"
    cant do that.. what i want is to round up a decimal whether it is < .5..

    example: 5.10 will be 6.00 not 5.00..
    ________
    DC MEDICAL MARIJUANA DISPENSARIES
    Last edited by rothj0hn; Feb 15th, 2011 at 01:55 PM.

  6. #6
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: Decimal numbers..

    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: Decimal numbers..

    thanks a lot..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width