heynemann/pyvows — pull request #63 by Zearin (2013-01-07 22:52:00+00:00)
Title: Use decimal values for `coverage`

**NOTE: This change required a small (but important) modification to a few tests!**

## Rationale for change

* Python’s `str.format()` has a built-in mechanism for formatting a decimal value as a percent.
* In `reporting.py`, percents were calculated manually. This meant that if an attempt was made to use `str.format()`’s built-in percentage format on `coverage`, we had to divide by 100
* The manually-calculated percentages also had the potential to truncate digits, causing data loss; ideally, the raw data should be preserved until the time comes to format it as a string, at which point the number of digits should be specified in `str.format()`

## Benefits
* `reporting.py` now uses built-in methods to format percentages, which we don’t have to maintain (yay!)
* `coverage` is now consistent within `reporting.py` and values produced in the
* No digits will be truncated; client code can decide how many (or how few) digits to use with `str.format()`
* No need to manually insert a “%” into output strings

## Changed Tests
* This change required modifying a few tests to expect decimal values ranging from `0.000`–`1.000` (instead of `00.0`–`100.0`)