Lanc1988 Posted June 1, 2004 Posted June 1, 2004 What code do I use to format a number so it has commas every 3 digit? Like right now my label displays 1999999 but i want it to be 1,999,999 Quote
Administrators PlausiblyDamp Posted June 1, 2004 Administrators Posted June 1, 2004 Dim i As Integer = 1999999 Label1.Text = i.ToString("N") Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Lanc1988 Posted June 1, 2004 Author Posted June 1, 2004 ok, im not quite sure how to add that in to what I have already.. heres what it needs to be added to: ExpNeeded = Target - Current 'Stores how much exp is needed for target lblExpNeeded.Text = ExpNeeded 'Displays needed exp in label it needs to put commas in the lblExpNeeded.Text = ExpNeeded part Quote
Administrators PlausiblyDamp Posted June 1, 2004 Administrators Posted June 1, 2004 Try the following (assuming ExpNeeded is a numeric variable) ExpNeeded = Target - Current 'Stores how much exp is needed for target lblExpNeeded.Text = ExpNeeded.ToString("N") 'Displays needed exp in label Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Lanc1988 Posted June 1, 2004 Author Posted June 1, 2004 its underlining the ("N") in blue.. do i need to do something like Dim N As something? Quote
Administrators PlausiblyDamp Posted June 1, 2004 Administrators Posted June 1, 2004 If you wave your mouse over the blue line what does the tooltip say? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.