Changeset 10536 for trunk/qt/utils.cc


Ignore:
Timestamp:
Apr 28, 2010, 1:26:46 AM (12 years ago)
Author:
charles
Message:

(trunk) #3174 "Use IEC standard units (KiB, MiB, GiB) instead of (KB, MB, GB)" -- implemented for gtk, qt, daemon, cli, and web client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/utils.cc

    r9868 r10536  
    5252        {
    5353            displayed_size = (double)size / KILOBYTE_FACTOR;
    54             str = tr( "%L1 KB" ).arg( displayed_size,  0, 'f', 1 );
     54            str = tr( "%L1 KiB" ).arg( displayed_size,  0, 'f', 1 );
    5555        }
    5656        else if( size < (int64_t)GIGABYTE_FACTOR )
    5757        {
    5858            displayed_size = (double)size / MEGABYTE_FACTOR;
    59             str = tr( "%L1 MB" ).arg( displayed_size,  0, 'f', 1 );
     59            str = tr( "%L1 MiB" ).arg( displayed_size,  0, 'f', 1 );
    6060        }
    6161        else
    6262        {
    6363            displayed_size = (double) size / GIGABYTE_FACTOR;
    64             str = tr( "%L1 GB" ).arg( displayed_size,  0, 'f', 1 );
     64            str = tr( "%L1 GiB" ).arg( displayed_size,  0, 'f', 1 );
    6565        }
    6666    }
     
    144144    QString str;
    145145
    146     if( kbps < 1000.0 )  /* 0.0 KB to 999.9 KB */
    147         str = tr( "%L1 KB/s" ).arg( kbps, 0, 'f', 1 );
    148     else if( kbps < 102400.0 ) /* 0.98 MB to 99.99 MB */
    149         str = tr( "%L1 MB/s" ).arg( kbps/1024.0, 0, 'f', 2 );
     146    if( kbps < 1000.0 )  /* 0.0 KiB to 999.9 KiB */
     147        str = tr( "%L1 KiB/s" ).arg( kbps, 0, 'f', 1 );
     148    else if( kbps < 102400.0 ) /* 0.98 MiB to 99.99 MiB */
     149        str = tr( "%L1 MiB/s" ).arg( kbps/1024.0, 0, 'f', 2 );
    150150    else // insane speeds
    151         str = tr( "%L1 GB/s" ).arg( kbps/(1024.0*1024.0), 0, 'f', 1 );
     151        str = tr( "%L1 GiB/s" ).arg( kbps/(1024.0*1024.0), 0, 'f', 1 );
    152152
    153153    return str;
Note: See TracChangeset for help on using the changeset viewer.