right-justify formatted integers

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

How to string format an integer to be right-justified within a field width
of a specified number of characters ?

in the following example , 'x' denotes space character

xxxx0
xxxx1
....
xxxx9
xxx10
xxx11
 
John said:
How to string format an integer to be right-justified within a field width
of a specified number of characters ?

in the following example , 'x' denotes space character

xxxx0
xxxx1
...
xxxx9
xxx10
xxx11

String.Format("{0,5}", v)

is one way.

Arne
 
Back
Top