String Formatting when Printing
-
Hi everyone, I'm running into a problem while trying to format strings for printing. I'm working heavily with finance and I need the values to be flushed right and formatted as cash. Unfortunately none of the values are being formatted correctly. I assumed that if the String.Format() function was used correctly that the string would be returned with all the information needed to line it up correctly. I ran into a similar problem when trying to line up information in combo boxes. What I think is going on is that the width of a space is much smaller then the width of the characters in a font. Does anyone know of a workaround for this? Thanks. - Will
-
Hi everyone, I'm running into a problem while trying to format strings for printing. I'm working heavily with finance and I need the values to be flushed right and formatted as cash. Unfortunately none of the values are being formatted correctly. I assumed that if the String.Format() function was used correctly that the string would be returned with all the information needed to line it up correctly. I ran into a similar problem when trying to line up information in combo boxes. What I think is going on is that the width of a space is much smaller then the width of the characters in a font. Does anyone know of a workaround for this? Thanks. - Will
Sure, the easy way out is to display/print (parts of) the text using a so called "non-proportional" font; such font has all characters (including the space char) with the same width. An example is "Courier New". :)
Luc Pattyn [My Articles] [Forum Guidelines]
-
Sure, the easy way out is to display/print (parts of) the text using a so called "non-proportional" font; such font has all characters (including the space char) with the same width. An example is "Courier New". :)
Luc Pattyn [My Articles] [Forum Guidelines]