I need to display several columns of numbers in a textbox. I wish to
display the columns with the decimal point position aligned vertically.
I have found that the # digit placeholders do not reserve the spaces for the
number if the number of digits are fewer than the number of placeholders.
My simplified example: included within a loop such that it displays two
columns
Text1.Text = Text1.Text & Format(x, " ###.#0") & _
Format(y, " #,###.0") & _
vbCrLf
The digit place holders do not hold the places when the number of digits in
the values of x and y are fewer than the number of place holders (#). This
causes the columns to not align.
I can make the columns align by placing a (0) placeholder at the most
significant digit to the left of the decimal but then the columns are
displayed with numbers of leading zeros depending on how many significant
digits are actually required to display the value in a particular row.
Example:
00000012.01 2345 0000000000.25
Help would be appreciated.
I recall that this was the only method to reserve spaces for the purposes of
alignment of columns in earlier forms of Basic and Fortran. It seems that
VB digit placeholders only reserve spaces for actual digits of the value to
be displayed.