summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-11-25 22:32:54 +0200
committerPaul Buetow <paul@buetow.org>2025-11-25 22:32:54 +0200
commitb97e4b19ec9c415cd5f3d204e23e5fde5180db26 (patch)
treeaf324415c9e0e71724d4a920a62cc4295877dbc0 /README.md
Initial commit: perc v0.0.0 - percentage calculatorv0.0.0
Amp-Thread-ID: https://ampcode.com/threads/T-e4f4a959-8cc6-4ac0-b6fb-2779867e8b2a Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md67
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.