Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix just-percentile docs to reflect that percentile is between 0 and 1 #515

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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