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.
- Host: GitHub
- URL: https://github.com/baalimago/percentaverage
- Owner: baalimago
- License: mit
- Created: 2023-12-22T13:50:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-23T17:53:06.000Z (over 1 year ago)
- Last Synced: 2025-02-11T17:23:25.878Z (8 months ago)
- Topics: average-calculator, cli, go, golang, math, percentage, tool
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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