Code review comment for lp:~diegosarmentero/click-update-manager/bytes-to-size

Revision history for this message
Mike McCracken (mikemc) wrote :

In utils.js, the calculation "parseFloat(bytes / 1024).toFixed(2)" is strange.
per IRC, bytes will be an int, so we're dividing two ints then apparently implicitly converting them to strings before passing them to parseFloat(), which generates a float.

If you just remove "parseFloat" and divide by a float, it works the same but makes more sense to me.

like this:

var size = (bytes / 1024.0).toFixed(2);

review: Needs Fixing

« Back to merge proposal