Lo que tienes que lograr es que todos los números tengan la misma cantidad de decimales y luego utilizar
este truco.
Código Delphi
[-]
procedure TForm1.FormCreate(Sender: TObject) ;
begin
ComboBox1.Style := csOwnerDrawFixed;
end;
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState) ;
var
x: Integer;
txt: String;
begin
with ComboBox1 do
begin
Canvas.FillRect(Rect) ;
txt := Items[Index];
x := Rect.Right - Canvas.TextWidth(txt) - 4;
Canvas.TextOut(x, Rect.Top, txt) ;
end;
end;
Para lo de los decimales mira la función Format().
Ejemplo de Delhi 6:
Código Delphi
[-]
Format('%8.2f', [123.456]).
También se pueden agregar más elementos...
Código Delphi
[-]
Format('Cantidad %d * € %8.2f = %8.2f', [12, 123.456, (12 * 123.456)])