Changeset 8275


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/daemon/remote.c

    r8044 r8275  
    1212
    1313#include <errno.h>
     14#include <math.h>
    1415#include <stdio.h>
    1516#include <stdlib.h>
     
    708709            double percent;
    709710            if( tr_bencDictFindDouble( t, "recheckProgress", &percent ) )
    710                 tr_snprintf( buf, buflen, "%s (%.0f%%)", str, percent*100.0 );
     711                tr_snprintf( buf, buflen, "%s (%.0f%%)", str, floor(percent*100.0) );
    711712            else
    712713                tr_strlcpy( buf, str, buflen );
     
    10331034                        printf( "%3d: %3.0f%% %-8s %-3s %9s  %s\n",
    10341035                                j,
    1035                                 ( 100.0 * percent ),
     1036                                floor( 100.0 * percent ),
    10361037                                pristr,
    10371038                                ( wanted ? "Yes" : "No" ),
Note: See TracChangeset for help on using the changeset viewer.