Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Probably easy list box question
Message
From
28/12/1998 17:03:51
 
 
To
28/12/1998 09:50:07
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00170748
Message ID:
00170953
Views:
15
>I've got a listbox that has several columns in it. The source is a SQL statement. The second column is created by the sql segment "transform(total, "$$$,$$$.99")" (just in case that's important). I need to line up the decimal points but don't know how. How can I get these numbers to line up? Thanks!

Hello Denise!

You donnot need to use monospaced font! I use MS SANS SERIFF and with foolowing function works perfectly: It makes equal length strings. I usually use 22 as tnWidth. (You can put the whole function in one big iif statement)

function cFormatCurrency
lparameter tyAmount, tnWidth
local lcVissza, lnSpaceSzam, lyAmount
if sign(tyAmount)=-1
tnWidth=tnWidth+1
endif
lcVissza=alltrim(transform(tyAmount,"### ### ###.##"))
lnSpaceSzam=occurs(' ',lcVissza)
lcVissza=space(max(tnWidth-lnSpaceSzam-2*(len(lcVissza)-lnSpaceSzam-1),0))+lcVissza
return lcVissza

A second solution is: use my free BBListView ocx (available here in UT in file section/ 3rd partyproducts), which natively supports right/center aligned columns.

BB
Previous
Reply
Map
View

Click here to load this message in the networking platform