Changeset 8274


Ignore:
Timestamp:
Apr 22, 2009, 9:00:52 PM (13 years ago)
Author:
charles
Message:

(trunk daemon) fix rounding error in transmission-remote display. Patch by wereHamster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r8235 r8274  
    1212
    1313#include <errno.h>
     14#include <math.h>
    1415#include <stdio.h>
    1516#include <stdlib.h>
     
    737738            double percent;
    738739            if( tr_bencDictFindReal( t, "recheckProgress", &percent ) )
    739                 tr_snprintf( buf, buflen, "%s (%.0f%%)", str, percent*100.0 );
     740                tr_snprintf( buf, buflen, "%s (%.0f%%)", str, floor(percent*100.0) );
    740741            else
    741742                tr_strlcpy( buf, str, buflen );
     
    10831084                        printf( "%3d: %3.0f%% %-8s %-3s %9s  %s\n",
    10841085                                j,
    1085                                 ( 100.0 * percent ),
     1086                                floor( 100.0 * percent ),
    10861087                                pristr,
    10871088                                ( wanted ? "Yes" : "No" ),
Note: See TracChangeset for help on using the changeset viewer.