ericpaulbishop/gargoyle — pull request #262 by BashfulBladder (2013-10-23 21:43:00+00:00)
Title: more flexible parseBytes() output

This patch ends common.js::parseBytes() from reliance on common.js::truncateDecimal() in favor of standard .toFixed(number_of_digits). parseBytes defaults to 3 digits but can now output fewer:

```javascript
parseBytes(78234,"mixed",1,1) -> 76.4kB
parseBytes(78234,"mixed",0,1) -> 76.4 kBytes
parseBytes(78234,"mixed",1) -> 76.400kB
parseBytes(78234,"mixed") -> 76.400 kBytes
```
-----------

Looks like common.js::truncateDecimal() can be eliminated in favor of a local variable.toFixed(3), but as I don't use tor, qos & quotas, I leave it to an invested party to implement.