User Profile

Collapse

Profile Sidebar

Collapse
Ricky71
Ricky71
Last Activity: Oct 5 '08, 05:12 AM
Joined: Oct 2 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thank you so much!
    It worked.

    If anyone else has this problem, this is what I changed:

    String.Format(" {0:#.00}", Math.Round(i + HighGrade, 2, MidpointRoundin g.AwayFromZero) ).PadLeft(4)

    After String.Format use this "{0:#.00}" and replace the number of 0's after the decimal to what you need.
    See more | Go to post

    Leave a comment:


  • Ricky71
    started a topic Math.Round does not always show two decimal places
    in .NET

    Math.Round does not always show two decimal places

    I'm writing a program in vb.net 2008 that calculates grades and puts them in a list. When I use Math.Round it will not show two decimal places for a number without decimals. For example:

    This is what I have

    100
    96.97
    93.94
    ...

    Is there a way to force 100 or any other number that does not have decimals to have .00 after it?

    Here is what I'm using in my code now
    ...
    See more | Go to post
No activity results to display
Show More
Working...