• 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))

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

{0,8}  and by N0

Thank you

1 Solution
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
KarlTheHopelessAuthor Commented:
thank you
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