>I have a list box with three columns. The third column display dollar amounts, but is left justified. Is there a way to get the column to right justify? Any feedback is appreciated.
>
>Marcus.
Hello Marcus!
The trick: expand all number for the same width,add some space on the the left side of the number. (The problem: width of a space char, how much wider or shrinker than a number, and a point? If these are equals, padl is suitable (Courier font type))
I used the following function for this problem:
(It is designed for MSSanserif font, I always use this one)
function cFormatCurrency
lparameter tyAmount, tnWidth
local lcVissza, lnNoOfSpaces
if sign(tyOsszeg)=-1
tnSzelesseg=tnSzelesseg+1
endif
lcVissza=alltrim(transform(tyAmount,"### ### ###.##"))
lnNoOfSpaces=occurs(' ',lcVissza)
lcVissza=space(max(tnWidth-lnNoOfSpaces-2*(len(lcVissza)-lnNoOfSpaces-1),0))+lcVissza
return lcVissza
Good luck!
BB
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only