percentile
calculates the percentile of the entered number.
percentile
calculates and displays the percentile of a number as it is entered.
To enter a number into percentile
, specify the file from which you want to enter the number, or enter the number from standard input.
# Read numbers from a file
$ percentile <(seq 1 100)
p25: 25
p50: 50
p75: 75
p90: 90
p95: 95
p99: 99
# Read numbers from a standard input
$ seq 1 100 | percentile -
p25: 25
p50: 50
p75: 75
p90: 90
p95: 95
p99: 99
# Calculate the specified percentile value
$ seq 1 100 | percentile -p25,50 -
p25: 25
p50: 50
# Do not round percentile values
$ seq 1 100 | percentile -r -
p25: 25.5
p50: 50.5
p75: 75.5
p90: 90.5
p95: 95.5
p99: 99.5
# Show help
$ percentile -h
Usage of percentile:
-p string
Specify percentiles (comma-separated list of integers) (default "25,50,75,90,95,99")
-r Don't Round percentile values
-v Show version
go install github.com/ebc-2in2crc/percentile/cmd/percentile@latest
Download from the following url.
Or, you can use Homebrew.
$ brew install ebc-2in2crc/tap/percentile
- Fork this repository
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Rebase your local changes against the master branch
- Run test suite with the
make test
command and confirm that it passes - Run
make fmt
andmake lint
- Create new Pull Request