MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / GetBytesStringEng

Function GetBytesStringEng

sourcecommon/utils.cpp:562–578  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

560}
561//---------------------------------------------------------------------------
562String GetBytesStringEng(ULONGLONG count)
563{
564 String rv;
565 // Gb >= 1
566 if( count >= ONE_GB )
567 rv.printf("%lu.%u Gb", count/ONE_GB, (WORD)((double)(count%ONE_GB)/(ONE_GB/10.0)));
568 // Mb >= 1
569 else if( count >= ONE_MB )
570 rv.printf("%lu.%u Mb", (ULONG)(count/ONE_MB), (WORD)((double)(count%ONE_MB)/(ONE_MB/10.0)));
571 // Kb >= 2
572 else if( count >= 2*ONE_KB )
573 rv.printf("%lu.%u Kb", count/ONE_KB, (WORD)((double)(count%ONE_KB)/(ONE_KB/10.0)));
574 // b >= 2
575 else
576 rv.printf("%lu bytes", count);
577 return rv;
578}
579//---------------------------------------------------------------------------
580AnsiString TimeIntervalToString(TDateTime interval)
581{

Callers 1

UpdateDislpayInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected