This commit is contained in:
2024-01-31 12:15:36 -05:00
parent bd1366faf6
commit de57298d0f
6 changed files with 64 additions and 8 deletions

View File

@@ -7,9 +7,12 @@ else
price=$(echo "$raw" | jq -r ".result.$1.b[0]")
fi
# echo "$price"
if (( $(echo "$price < 10" | bc -l) )); then
if (( $(echo "$price < 1" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3-
# printf "%0.3f\n" "$price"
elif (( $(echo "$price < 10" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3-
elif (( $(echo "$price < 1000" | bc -l) )); then
printf "%'0.1f\n" "$price" | sed 's/,//'
elif (( $(echo "$price < 10000" | bc -l) )); then
printf "%'0.0f\n" "$price" | sed 's/,//'
else