Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement