[RESOLVED] aligning currency or numbers by decimal point
Using the vb6 compatability printing regime.
Uisng simple code I'd like to align decimal ponts on quantities or currency figures so that report fields are vertically aligned eg
1,234.56 and 40 need to be aligned so that the 40 is directly beneath the 34 The aligning of the left is easy, but not correct for quantities that may differ widely and only the decimal point is the correct reference.
The way I did it with Vb6 was
HTML Code:
Aligned = Format(Amount,"#,###")
Printer.CurrentX=125-Printer.TextWidth(Aligned)
Printer.Print Aligned
Re: aligning currency or numbers by decimal point
1. You need to use a fixed width font.
2. You need to use String.PadLeft to make all the strings the same length
3. In case of even numbers such as 40, you need to format it to show the decimal part too, i.e "40.00"
Re: aligning currency or numbers by decimal point
I've found it thanks, without using a fixed width font.