Changeset 10536 for trunk/gtk/util.c


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/gtk/util.c

    r10512 r10536  
    135135        {
    136136            displayed_size = (gdouble) size / KILOBYTE_FACTOR;
    137             g_snprintf( buf, buflen, _( "%'.1f KB" ), displayed_size );
     137            g_snprintf( buf, buflen, _( "%'.1f KiB" ), displayed_size );
    138138        }
    139139        else if( size < (guint64)GIGABYTE_FACTOR )
    140140        {
    141141            displayed_size = (gdouble) size / MEGABYTE_FACTOR;
    142             g_snprintf( buf, buflen, _( "%'.1f MB" ), displayed_size );
     142            g_snprintf( buf, buflen, _( "%'.1f MiB" ), displayed_size );
    143143        }
    144144        else
    145145        {
    146146            displayed_size = (gdouble) size / GIGABYTE_FACTOR;
    147             g_snprintf( buf, buflen, _( "%'.1f GB" ), displayed_size );
     147            g_snprintf( buf, buflen, _( "%'.1f GiB" ), displayed_size );
    148148        }
    149149    }
     
    159159    const double speed = kb_sec;
    160160
    161     if( speed < 1000.0 )  /* 0.0 KB to 999.9 KB */
    162         g_snprintf( buf, buflen, _( "%'.1f KB/s" ), speed );
    163     else if( speed < 102400.0 ) /* 0.98 MB to 99.99 MB */
    164         g_snprintf( buf, buflen, _( "%'.2f MB/s" ), ( speed / KILOBYTE_FACTOR ) );
    165     else if( speed < 1024000.0 ) /* 100.0 MB to 999.9 MB */
    166         g_snprintf( buf, buflen, _( "%'.1f MB/s" ), ( speed / MEGABYTE_FACTOR ) );
     161    if( speed < 1000.0 )  /* 0.0 KiB to 999.9 KiB */
     162        g_snprintf( buf, buflen, _( "%'.1f KiB/s" ), speed );
     163    else if( speed < 102400.0 ) /* 0.98 MiB to 99.99 MiB */
     164        g_snprintf( buf, buflen, _( "%'.2f MiB/s" ), ( speed / KILOBYTE_FACTOR ) );
     165    else if( speed < 1024000.0 ) /* 100.0 MiB to 999.9 MiB */
     166        g_snprintf( buf, buflen, _( "%'.1f MiB/s" ), ( speed / MEGABYTE_FACTOR ) );
    167167    else /* insane speeds */
    168         g_snprintf( buf, buflen, _( "%'.2f GB/s" ), ( speed / GIGABYTE_FACTOR ) );
     168        g_snprintf( buf, buflen, _( "%'.2f GiB/s" ), ( speed / GIGABYTE_FACTOR ) );
    169169
    170170    return buf;
Note: See TracChangeset for help on using the changeset viewer.