Quote:
Originally Posted by Andre Jesus
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)