Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#3298 closed Enhancement (fixed)

Prettier formating of percentages

Reported by: Longinus00 Owned by: Longinus00
Priority: Normal Milestone: 2.10
Component: Transmission Version: 2.00
Severity: Minor Keywords:
Cc:

Description

I feel it is ugly having percentage strings that read 100.00% as any percentage above 100% is meaningless for our purposes. To solve this I propose introducing a function whose sole purpose is to format a double to a nice percent string.

I followed the model of the ratio printing function and have it return a 2 decimal place string when x < 10, a 1 decimal place string when x < 100 and no decimal places otherwise. I also took the liberty of trying to ferret out all the places where numbers are rounded when they really should be truncated.

Attachments (2)

fixPercentStrings.patch (24.2 KB) - added by Longinus00 12 years ago.
fixPercentStrings2.patch (26.1 KB) - added by Longinus00 12 years ago.

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by Longinus00

comment:1 Changed 12 years ago by livings124

  • Severity changed from Normal to Minor

comment:2 Changed 12 years ago by charles

We should probably make a common formatter that the C-based languages can use, rather than reinventing the wheel again and again.

comment:3 Changed 12 years ago by Longinus00

I updated with a common formatter cribbed from #3045.

Changed 12 years ago by Longinus00

comment:4 Changed 12 years ago by Longinus00

Yet another revision that moved everything to utils.c

comment:5 Changed 12 years ago by Longinus00

Committed in r10822.

comment:6 Changed 12 years ago by Longinus00

  • Resolution set to fixed
  • Status changed from new to closed

comment:7 Changed 12 years ago by livings124

r10832 for the Mac client implementation

Last edited 12 years ago by livings124 (previous) (diff)
Note: See TracTickets for help on using tickets.