Skip to content

Commit

Permalink
sendawaynn_subsidy.sh: fix printf invalid number error
Browse files Browse the repository at this point in the history
we forgot that there can be different locales, with different
decimal separators (can be . or ,). explicit use of LC_ALL=C
should solve any kind of such errors.
  • Loading branch information
DeckerSU committed Dec 11, 2024
1 parent 5219060 commit fe7e20f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sendawaynn_subsidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

set -euo pipefail
IFS=$'\n\t'
export LC_ALL=C

# Configuration
LOG_FILE="$HOME/litecoin_tx.log"
Expand Down Expand Up @@ -95,7 +96,7 @@ log "$INPUTS"
log "Total Amount of Selected UTXOs: $TOTAL_AMOUNT LTC"

# Calculate amount to send
AMOUNT_TO_SEND=$(echo "$TOTAL_AMOUNT - $FEE" | bc -l)
AMOUNT_TO_SEND=$(echo "$TOTAL_AMOUNT - $FEE" | bc -l | tr -d '\n')
AMOUNT_TO_SEND=$(printf "%.8f" "$AMOUNT_TO_SEND")

# Check if amount to send is positive
Expand Down

0 comments on commit fe7e20f

Please sign in to comment.