Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Probably easy list box question
Message
De
28/12/1998 17:03:51
 
 
À
28/12/1998 09:50:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00170748
Message ID:
00170953
Vues:
16
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform