var
CurrCont: TDateTime = 0;
Str: String;
procedure SumCont(Cont: String);
begin
if Length(Cont) > 8 then CurrCont := CurrCont + StrToDateTime(Copy(Cont, Length(Cont) - 7, 8)) + StrToFloat(Copy(Cont, 0, Length(Cont) - 9))
else CurrCont := CurrCont + StrToDateTime(Copy(Cont, Length(Cont) - 7, 8));
end;
function GetSumCont(): String;
begin
if CurrCont >= 1 then
begin
Str := DateTimeToStr(CurrCont);
Str := IntToStr(Trunc(CurrCont)) + 'сут. ' + Copy(Str, Length(Str) - 7, 8);
//Str := IntToStr(Trunc(CurrCont) * 24 + StrToInt(Copy(Str, Length(Str) - 7, 2))) + Copy(Str, Length(Str) - 5, 6);
end
else
begin
Str := DateTimeToStr(CurrCont);
Str := Copy(Str, Length(Str) - 7, 8);
end;
result := Str;
end; |