Commit 696cbf8b authored by rswindell's avatar rswindell
Browse files

Added a rounded/estimated file size (in parenthesis) to the FiFileSize

output. Example:
File size        : 7,128,414 (6.8M) bytes
parent f9843118
......@@ -374,7 +374,7 @@
"\r\n\1n\1gLibrary :\1h (%u) %s" 314 FiLib
"\r\n\1n\1gDirectory :\1h (%u) %s" 315 FiDir
"\r\n\1n\1gFilename :\1h %s" 316 FiFilename
"\r\n\1n\1gFile size :\1h %s" 317 FiFileSize
"\r\n\1n\1gFile size :\1h %s (%s) bytes" 317 FiFileSize
"\r\n\1n\1gCredit value :\1h %s" 318 FiCredits
"\r\n\1n\1gDescription :\1h %s" 319 FiDescription
"\r\n\1n\1gUploaded by :\1h %s" 320 FiUploadedBy
......
......@@ -43,6 +43,7 @@ void sbbs_t::fileinfo(file_t* f)
{
char ext[513];
char tmp[512];
char tmp2[64];
char path[MAX_PATH+1];
char fname[MAX_PATH+1];
char* real_fname;
......@@ -66,7 +67,8 @@ void sbbs_t::fileinfo(file_t* f)
bprintf(text[FiFilename], real_fname);
if(f->size!=-1L)
bprintf(text[FiFileSize],ultoac(f->size,tmp));
bprintf(text[FiFileSize],ultoac(f->size,tmp)
, byte_estimate_to_str(f->size, tmp2, sizeof(tmp2), /* units: */1024, /* precision: */1));
bprintf(text[FiCredits]
,(cfg.dir[f->dir]->misc&DIR_FREE || !f->cdt) ? "FREE" : ultoac(f->cdt,tmp));
bprintf(text[FiDescription],f->desc);
......
......@@ -647,7 +647,8 @@ void sbbs_t::qwk_sec()
l=(long)flength(str);
bprintf(text[FiFilename],getfname(str));
bprintf(text[FiFileSize],ultoac(l,tmp));
bprintf(text[FiFileSize],ultoac(l,tmp)
, byte_estimate_to_str(l, tmp2, sizeof(tmp), /* units: */1024, /* precision: */1));
if(l>0L && cur_cps)
i=l/(ulong)cur_cps;
else
......
......@@ -509,7 +509,8 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x0d\x0a\x01\x6e\x01\x67\x44\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x20\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x28\x25\x75\x29\x20"
"\x25\x73" // 315 FiDir
,"\x0d\x0a\x01\x6e\x01\x67\x46\x69\x6c\x65\x6e\x61\x6d\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73" // 316 FiFilename
,"\x0d\x0a\x01\x6e\x01\x67\x46\x69\x6c\x65\x20\x73\x69\x7a\x65\x20\x20\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73" // 317 FiFileSize
,"\x0d\x0a\x01\x6e\x01\x67\x46\x69\x6c\x65\x20\x73\x69\x7a\x65\x20\x20\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73\x20\x28\x25"
"\x73\x29\x20\x62\x79\x74\x65\x73" // 317 FiFileSize
,"\x0d\x0a\x01\x6e\x01\x67\x43\x72\x65\x64\x69\x74\x20\x76\x61\x6c\x75\x65\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73" // 318 FiCredits
,"\x0d\x0a\x01\x6e\x01\x67\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73" // 319 FiDescription
,"\x0d\x0a\x01\x6e\x01\x67\x55\x70\x6c\x6f\x61\x64\x65\x64\x20\x62\x79\x20\x20\x20\x20\x20\x20\x3a\x01\x68\x20\x25\x73" // 320 FiUploadedBy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment