VirtualBox

Ignore:
Timestamp:
Aug 29, 2019 11:58:21 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/string.h: Added added two more human readable size formatting variants for skipping the 'i' in 'KiB' and such. Made the human readable size formatting use the space format flag to specify a space between the value and the unit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp

    r76553 r80496  
    775775    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10Rhcb%u", UINT64_C(6678345), 42);
    776776    CHECKSTR("    6.3MiB42");
     777    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10Rhcb%u", UINT64_C(6710886), 42);
     778    CHECKSTR("    6.3MiB42");
     779    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10Rhcb%u", UINT64_C(6710887), 42);
     780    CHECKSTR("    6.4MiB42");
     781    cch = RTStrPrintf(pszBuf, BUF_SIZE, "% 10Rhcb%u", UINT64_C(6710887), 42);
     782    CHECKSTR("   6.4 MiB42");
     783    cch = RTStrPrintf(pszBuf, BUF_SIZE, "% 10RhcB%u", UINT64_C(6710887), 42);
     784    CHECKSTR("    6.4 MB42");
    777785
    778786    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10Rhub%u", UINT64_C(6678345), 42);
    779787    CHECKSTR("     6.3Mi42");
     788    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10RhuB%u", UINT64_C(6678345), 42);
     789    CHECKSTR("      6.3M42");
    780790
    781791    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%10Rhci%u", UINT64_C(6678345), 42);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette