Skip to content

Commit

Permalink
product-pricelimiter.sh generix currency
Browse files Browse the repository at this point in the history
Remove € signs as this works for, e.g., $ & £, too.
  • Loading branch information
oh2fih committed Aug 7, 2024
1 parent 7ef4327 commit fce5eb6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/product-pricelimiter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,26 @@ fi

if [ "$maxprice" == "$price" ]; then
echo -ne "\033[0;32mGood to buy! "
echo -e "The price (#$n in \"$selector\") is now exactly $price\033[0m"
echo -e "The price (#$n in \"$selector\") is now exactly $price\033[0m"
exit 0
fi

if [ "$isLower" = 1 ]; then
echo -ne "\033[0;32mGood to buy! "
echo -e "The price (#$n in \"$selector\") is now $price\033[0m"
echo -e "The price (#$n in \"$selector\") is now $price\033[0m"
if command -v bc &> /dev/null; then
diff=$(echo "scale=2; ($maxprice - $price)/1" | bc)
echo -ne "\033[0;32mThat is $diff lower "
echo -e "than the max price ($maxprice)\033[0m"
echo -ne "\033[0;32mThat is $diff lower "
echo -e "than the max price ($maxprice)\033[0m"
fi
exit 0
else
echo -ne "\033[0;33mPlease be patient! "
echo -e "The price (#$n in \"$selector\") is still $price\033[0m"
echo -e "The price (#$n in \"$selector\") is still $price\033[0m"
if command -v bc &> /dev/null; then
diff=$(echo "scale=2; ($price - $maxprice)/1" | bc)
echo -ne "\033[0;33mThat is $diff higher "
echo -e "than the max price ($maxprice)\033[0m"
echo -ne "\033[0;33mThat is $diff higher "
echo -e "than the max price ($maxprice)\033[0m"
fi
exit 2
fi

0 comments on commit fce5eb6

Please sign in to comment.