I need a function to calculate how many spaces I have to place in front of each number in a listbox column to have the numbers perfectly right-aligned inside the column. I don't want to have to use a fixed-pitch font.
The problem is that a space character is a fractional width of a digit in most fonts, so there is no integer amount of spaces that will pad a variable number of digits so the points align.
Has anybody solved this puzzle?
Vidar Johannessen