Skip to content

Commit

Permalink
Update controller.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
christian1980nrw authored Jan 1, 2024
1 parent b258827 commit 2390ebd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ elif [ "$price_unit" = "total" ]; then
print total
}' "$file" > "$output_file"
elif [ "$price_unit" = "tax" ]; then
awk -v vat_rate="$vat_rate" '/data_price_hour_rel_.*_amount: / {
awk -v vat_rate="$vat_rate" -v energy_fee="$energy_fee" '/data_price_hour_rel_.*_amount: / {
amount = substr($0, index($0, ":") + 2)
tax = amount * (1 + vat_rate)
tax = (amount * vat_rate) + energy_fee
print tax
}' "$file" > "$output_file"
else
Expand Down

0 comments on commit 2390ebd

Please sign in to comment.