• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

formatting numbers

The code below is from the MSDN library.
.....
 Generate and display 5 random integers from 50 to 100.
Console.WriteLine("Five random integers between 50 and 100:")
For ctr As Integer = 0 To 4
   Console.Write("{0,8:N0}", rand.Next(50, 101))
Next
....      

Can someone please explain what exactly is meant by the ...

{0,8}  and by N0

Thank you

0
KarlTheHopeless
Asked:
KarlTheHopeless
1 Solution
 
nmarunCommented:
The zero is to show the first parameter - rand.Next(50, 101))
The eight says to reserve 8 columns of width
N0 means zero decimal places
0
 
KarlTheHopelessAuthor Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now