An open API service indexing awesome lists of open source software.

https://github.com/baalimago/percentaverage

A tool which takes some input, finds all percentage-strings, then averages them.
https://github.com/baalimago/percentaverage

average-calculator cli go golang math percentage tool

Last synced: 6 months ago
JSON representation

A tool which takes some input, finds all percentage-strings, then averages them.

Awesome Lists containing this project

README

          

# percentaverage
A tool which finds all precentages in a file and averages them. Matches `x.y%`, `x,y%`, `-x.y%`.

Test coverage: 77.4% 😌👏

### Installation
```bash
go install github.com/baalimago/percentaverage@latest
```

## Usage

```bash
echo "20,3% 19.9% -0.2%" | percentaverage && echo
```

```bash

go test ./... -cover | percentaverage -r `# This will output the percentage wihout a '%' sign`
```

## Roadmap
- [x] Parse stdin
- [ ] Hyperdrive the parsing for fun (fun not guaranteed)
- [ ] Parse file from `-f` flag
- [ ] Parse all files from directory using `-d` flag
- [ ] Paralellized parsing
- [ ] Glob parsing using `-g` flag
- [ ] Glob parsing using multi-arguments