Merge pull request #93 from Flet/even-prettier-bytes

switch to prettier-bytes
This commit is contained in:
Feross Aboukhadijeh
2016-03-08 12:41:58 -08:00
2 changed files with 2 additions and 11 deletions

View File

@@ -3,16 +3,7 @@ module.exports = TorrentList
var h = require('virtual-dom/h')
var hyperx = require('hyperx')
var hx = hyperx(h)
var pb = require('pretty-bytes')
function prettyBytes (b) {
var pretty = pb(b)
var ps = pretty.split(/\.| /)
// if there is more than one digit to the left of the decimal, chop off the fractional part.
if (ps.length > 2 && ps[0].replace('-', '').length > 1) return ps[0] + ' ' + ps[2]
return pretty
}
var prettyBytes = require('prettier-bytes')
function TorrentList (state, dispatch) {
var list = state.saved.torrents.map(