Skip to content

Commit f909ad1

Browse files
committed
Merge pull request #41 from avoidwork/edge
Updating README
2 parents 987cf39 + 49ecfc2 commit f909ad1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.png)](http://travis-ci.org/avoidwork/filesize.js)
22
# filesize.js
33

4-
filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string. An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output. An optional third parameter lets you disable `bit` sizes, e.g. "Kb".
4+
filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string. An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output. An optional third parameter lets you disable `bit` sizes, e.g. "kb".
55

66
## Examples
77

8+
0.10.0 switched to base 10, all previous versions use base 2.
9+
810
```javascript
9-
filesize(500); // "3.91 Kb"
10-
filesize(500, true); // "3.9k"
11-
filesize(1500); // "1.46 KB"
12-
filesize("1500000000"); // "1.40 GB"
13-
filesize("1500000000", 0); // "1 GB"
14-
filesize(1212312421412412); // "1.08 PB"
11+
filesize(500); // "4.00 Kb"
12+
filesize(500, true); // "4.0k"
13+
filesize(1500); // "1.50 KB"
14+
filesize("1500000000"); // "1.50 GB"
15+
filesize("1500000000", 0); // "2GB"
16+
filesize(1212312421412412); // "1.21 PB PB"
1517
filesize(1212312421412412, true); // "1.1P" - shorthand output, similar to "ls -h"
16-
filesize(265318, 2, false) // "259.10 KB" - disabled `bit` sizes with third argument
18+
filesize(265318, 2, false) // "265.32 kB" - disabled `bit` sizes with third argument
1719
```
1820

1921
## How can I load filesize.js?

0 commit comments

Comments
 (0)