mirror of
https://github.com/FBukovina/burn-baby-burn.git
synced 2026-10-27 15:14:32 +00:00
add pic
This commit is contained in:
parent
c108c8175e
commit
bdb23e00d7
3 changed files with 18 additions and 4 deletions
|
|
@ -1,5 +1,7 @@
|
|||
# burn-baby-burn
|
||||
|
||||

|
||||
|
||||
> *"Burn, baby, burn — disco inferno."*
|
||||
> — The Trammps, 1976, on the subject of API quotas
|
||||
|
||||
|
|
|
|||
20
bin/burn
20
bin/burn
|
|
@ -288,6 +288,16 @@ round_cents() {
|
|||
awk -v c="$1" 'BEGIN{printf "%.2f", c}'
|
||||
}
|
||||
|
||||
# Format a non-negative integer with thousands-grouping commas (21826 -> 21,826).
|
||||
fmt_num() {
|
||||
local n=$1 result=""
|
||||
while ((n >= 1000)); do
|
||||
result=$(printf ",%03d%s" $((n % 1000)) "$result")
|
||||
n=$((n / 1000))
|
||||
done
|
||||
printf "%d%s" "$n" "$result"
|
||||
}
|
||||
|
||||
on_interrupt() {
|
||||
if [[ -n "$claude_pid" ]]; then
|
||||
kill "$claude_pid" 2>/dev/null || true
|
||||
|
|
@ -367,7 +377,9 @@ done
|
|||
cost_rounded=$(round_cents "$total_cost")
|
||||
msg="${CELEBRATIONS[RANDOM % ${#CELEBRATIONS[@]}]}"
|
||||
|
||||
printf "\n\n%s\n\n" "$msg"
|
||||
printf " 🔥 torched %s fire tokens across %s call(s) (target: %s)\n" \
|
||||
"$burned" "$iteration" "$tokens"
|
||||
printf " 💰 spent \$%s\n\n" "$cost_rounded"
|
||||
burned_fmt=$(fmt_num "$burned")
|
||||
tokens_fmt=$(fmt_num "$tokens")
|
||||
|
||||
printf "\n\n 🔥 torched %s tokens across %s call(s) (target: %s) • 💰 spent \$%s 💵💵💵\n\n" \
|
||||
"$burned_fmt" "$iteration" "$tokens_fmt" "$cost_rounded"
|
||||
printf " %s\n\n" "$msg"
|
||||
|
|
|
|||
BIN
burn.png
Normal file
BIN
burn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
Loading…
Add table
Add a link
Reference in a new issue