i think it is possible to change to
%total-size% return the unit without 'B' , in the same time we can modify %item-size%
the delphi function must return only the value and the unit without the 'B'
function smartsize(size:int64):string;
begin
if size < 0 then result:='N/A'
else
if size < 1 shl 10 then result:=format('%d ',[size])
else
if size < 1 shl 20 then result:=format('%f K',[size/(1 shl 10)])
else
if size < 1 shl 30 then result:=format('%f M',[size/(1 shl 20)])
else result:=format('%f G',[size/(1 shl 30)])
end; // smartsize
<div id='folder-stats'>%number-folders% {.!folders.}, %number-files% {.!files.}, %total-size%{.!unit.}
then in the template it will possible to use as unit one of
[special:string]
unit=Byte
unit=Octet
unit=Octeto
unit=Байт
unit=バイト
unit=字节
unit=בייט
for other values we can change the template or the delphi code
vars:
'%total-out%' '%total-in%' '%total-size%'
'%diskfree%' '%item-size%' '%done%' '%total%'
macros:
'smart size'
others: 6 update
HRM_REPLY: if not data.fullDLlogged then add2log(format('Served %s
B', [smartSize(conn.bytesSentLastItem)]), data);
HE_POST_END_FILE:
if logUploadsChk.checked and (data.uploadFailed = '') then
add2log(format('Fully uploaded - %s
B @ %d KB/s', [
smartSize(conn.bytesPostedLastItem),
calcAverageSpeed(conn.bytesPostedLastItem) ]), data);
HE_LAST_BYTE_DONE:
if logFulldownloadsChk.checked
and (data.downloadingWhat in [DW_FILE, DW_ARCHIVE]) then
begin
data.fullDLlogged:=TRUE;
add2log(format('Fully downloaded - %s
B @ %d KB/s - %s', [
smartSize(conn.bytesSentLastItem),
calcAverageSpeed(conn.bytesSentLastItem), url_]), data);
end;
sbarIdxs.totalOut:=addPanel( format('Total Out: %s
B',[
smartSize(outTotalOfs+srv.bytesSent)]) );
sbarIdxs.totalIn:=addPanel( format('Total In: %s
B',[
smartSize(inTotalOfs+srv.bytesReceived)]) );
if f.isFile() then
result:=result+format(#13'Size: %s'#13'Downloads: %d
B',
[ smartsize(sizeofFile(f.resource)), f.DLcount ]);
in the template: 4 update
<div id='folder-stats'>%number-folders% {.!folders.}, %number-files% {.!files.},
%total-size%{.!unit.}[+file]
<td>
%item-size%{.!unit.}<td>%item-modified%<td>%item-dl-count%
[progress-upload-file]
{.if not|{.{.?only.} = down.}|{:
<li> Uploading
%total%{.!unit.} @ %speed-kb% KB/s
<br /><span class='fn'>%filename%</span>
[progress-download-file]
{.if not|{.{.?only.} = up.}|{:
<li> Downloading
%total%{.!unit.} <br>Speed: %speed-kb% KB/s
now it's time to apply all of them to the build 261.