View Single Post
  #601  
Old 13-06-2013, 09:13
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,751
Thanks: 2,181
Thanked 11,211 Times in 2,309 Posts
Razor12911 is on a distinguished road
Make an onchange for wizardform.diredit to update changes.

How to do one,

Code:
procedure DirEditOnChange(Sender: TObject);
begin
lbl.caption:= ExpandConstant('Espaço do Game : ') + MbOrTb(24000);
end;

WizardForm.DirEdit.OnChange:= @DirEditOnChange;
to add the two decimals use this mbortb

Code:
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' '+ 'MB'else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' '+'GB' else
Result:= NumToStr(Float/(1024*1024))+' '+'TB';
end;

Last edited by Razor12911; 13-06-2013 at 09:17.
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
buttignol (14-06-2013)
Sponsored Links