Results 1 to 3 of 3

Thread: [2008] Labels and Decimal Points [RESOLVED]

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Resolved [2008] Labels and Decimal Points [RESOLVED]

    Hey,

    I've got a label and i want it to go to 2 decimal places.
    The problem is if a whole number is entered it will only display 9 not 9.00

    Any solutions to this?

    Thanks.
    Last edited by Wulfgur; Jan 9th, 2008 at 04:00 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Labels and Decimal Points

    vb.net Code:
    1. myLabel.Text = myNumber.ToString("n2")
    MSDN has plenty of information on date/time and numeric format strings. You should read it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Re: [2008] Labels and Decimal Points

    Thanks, I'll check if MSDN has my answer first next time.

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