Skip to content

Commit

Permalink
Fix just-percentile docs to reflect that percentile is between 0 and 1 (
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-c authored Nov 19, 2022
1 parent cee3733 commit e7d52bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A [REPL](https://anguscroll.com/just) for every utility (powered by [RunKit](htt
## ES and CJS modules available for every utility <img src="images/esm.png" width="22"/> <img src="images/node.jpeg" width="18"/>

All packages support ES module or Common JS syntax without requiring transpilation
```js
```
// esm (node / bundler)
import clone from 'just-clone';
Expand Down Expand Up @@ -1652,14 +1652,14 @@ Return the value at the given percentile (using linear interpolation)
import percentile from 'just-percentile';
percentile([1, 2, 3], 0); // 1
percentile([1, 2, 3], 50); // 2
percentile([1, 2, 3], 100); // 3
percentile([1, 2, 3], 0.5); // 2
percentile([1, 2, 3], 1); // 3
// See https://en.wikipedia.org/wiki/Percentile (linear interpolation method)
percentile([15, 20, 35, 40, 50], 5); // 15
percentile([15, 20, 35, 40, 50], 30); // 20
percentile([15, 20, 35, 40, 50], 40); // 27.5
percentile([15, 20, 35, 40, 50], 95); // 50
percentile([15, 20, 35, 40, 50], 0.05); // 15
percentile([15, 20, 35, 40, 50], 0.3); // 20
percentile([15, 20, 35, 40, 50], 0.4); // 27.5
percentile([15, 20, 35, 40, 50], 0.95); // 50
percentile(1, 2, 3, 50); // throws
percentile(['1', 2, 3], 50); // throws
Expand Down
12 changes: 6 additions & 6 deletions md-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@
"import percentile from 'just-percentile';",
"",
"percentile([1, 2, 3], 0); // 1",
"percentile([1, 2, 3], 50); // 2",
"percentile([1, 2, 3], 100); // 3",
"percentile([1, 2, 3], 0.5); // 2",
"percentile([1, 2, 3], 1); // 3",
"",
"// See https://en.wikipedia.org/wiki/Percentile (linear interpolation method)",
"percentile([15, 20, 35, 40, 50], 5); // 15",
"percentile([15, 20, 35, 40, 50], 30); // 20",
"percentile([15, 20, 35, 40, 50], 40); // 27.5",
"percentile([15, 20, 35, 40, 50], 95); // 50",
"percentile([15, 20, 35, 40, 50], 0.05); // 15",
"percentile([15, 20, 35, 40, 50], 0.3); // 20",
"percentile([15, 20, 35, 40, 50], 0.4); // 27.5",
"percentile([15, 20, 35, 40, 50], 0.95); // 50",
"",
"percentile(1, 2, 3, 50); // throws",
"percentile(['1', 2, 3], 50); // throws",
Expand Down
12 changes: 6 additions & 6 deletions packages/array-percentile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Return the value at the given percentile (using linear interpolation)
import percentile from 'just-percentile';

percentile([1, 2, 3], 0); // 1
percentile([1, 2, 3], 50); // 2
percentile([1, 2, 3], 100); // 3
percentile([1, 2, 3], 0.5); // 2
percentile([1, 2, 3], 1); // 3

// See https://en.wikipedia.org/wiki/Percentile (linear interpolation method)
percentile([15, 20, 35, 40, 50], 5); // 15
percentile([15, 20, 35, 40, 50], 30); // 20
percentile([15, 20, 35, 40, 50], 40); // 27.5
percentile([15, 20, 35, 40, 50], 95); // 50
percentile([15, 20, 35, 40, 50], 0.05); // 15
percentile([15, 20, 35, 40, 50], 0.3); // 20
percentile([15, 20, 35, 40, 50], 0.4); // 27.5
percentile([15, 20, 35, 40, 50], 0.95); // 50

percentile(1, 2, 3, 50); // throws
percentile(['1', 2, 3], 50); // throws
Expand Down

0 comments on commit e7d52bc

Please sign in to comment.