diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ce4fdb --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# perc + +A simple command-line percentage calculator written in Go. + +## Installation + +```bash +go install codeberg.org/snonux/perc/cmd/perc@latest +``` + +Or using mage: + +```bash +mage install +``` + +## Usage + +`perc` supports various percentage calculation formats: + +### Calculate X% of Y + +```bash +perc 20% of 150 +# Output: 20.00% of 150.00 = 30.00 + +perc what is 20% of 150 +# Output: 20.00% of 150.00 = 30.00 +``` + +### Find what percentage X is of Y + +```bash +perc 30 is what % of 150 +# Output: 30.00 is 20.00% of 150.00 +``` + +### Find the whole when X is Y% of it + +```bash +perc 30 is 20% of what +# Output: 30.00 is 20.00% of 150.00 +``` + +## Building + +Using mage: + +```bash +mage build +``` + +Or using go directly: + +```bash +go build -o perc ./cmd/perc +``` + +## Testing + +```bash +mage test +``` + +## License + +See LICENSE file for details. |
