View Single Post
  #5  
Old 22-04-2013, 21:47
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,752
Thanks: 2,187
Thanked 11,212 Times in 2,310 Posts
Razor12911 is on a distinguished road
Quote:
Originally Posted by Andre Jesus View Post
I really tried find any reference about how to make the script, but i donīt find.
Can you give me an example?
example

sorry didn't also mention length

function MBToGB(MB : Integer): String;
begin
if Length(IntToStr(MB)) > 3 then
Result := Copy(IntToStr(MB), 0, Length(IntToStr(MB))-3) + '.' + Copy(IntToStr(MB), Length(IntToStr(MB))-2, 1) + ' GB'
else
Result := IntToStr(MB) + ' MB'
end;

how to use

Legend:
i = integer, a number to convert from MB to GB

MBToGB(i)
Reply With Quote