We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b012cd9 commit b318116Copy full SHA for b318116
commands/math/calculate-growth.sh
@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+# Required parameters:
4
+# @raycast.schemaVersion 1
5
+# @raycast.title Calculate Growth %
6
+# @raycast.mode compact
7
8
+# Optional parameters:
9
+# @raycast.icon 📈
10
+# @raycast.argument1 { "type": "text", "placeholder": "From" }
11
+# @raycast.argument2 { "type": "text", "placeholder": "To" }
12
13
+# Documentation:
14
+# @raycast.author Petr Nikolaev
15
+# @raycast.authorURL https://github.com/pitnikola
16
+# @raycast.description Calculate percentage increase between "from" and "to" values.
17
18
+GROWTH=$(echo "($2 / $1 - 1) * 100" | bc -l)
19
+GROWTH=$(printf "%.1f" $GROWTH)
20
+echo "$GROWTH" | pbcopy
21
+echo "Growth from $1 to $2 is $GROWTH%. Copied to clipboard."
0 commit comments