Changed printf LANG to LC_NUMERIC

It was displaying an error almost every time : invalid number float
This commit is contained in:
Maxime Chourré 2024-04-18 08:36:24 +02:00 committed by GitHub
parent b4948cf46f
commit 031a86d73b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,7 +122,7 @@ do
# Gernate a TempLight value for the screen to be set to
# Float math thanks Matthias_Wachter
TempLight=$(LANG=C printf "%.0f" $(echo "scale=2; $Light * $SensorToDisplayScale" | bc))
TempLight=$(LC_NUMERIC=C printf "%.0f" $(echo "scale=2; $Light * $SensorToDisplayScale" | bc))
# Check we dont ask the screen to go brighter than it can
@ -134,7 +134,7 @@ do
fi
# How diffrent should each stop be
DiffCount=$(LANG=C printf "%.0f" $(echo "scale=2; ( $NewLight - $CurrentBrightness ) / $LevelSteps" | bc ))
DiffCount=$(LC_NUMERIC=C printf "%.0f" $(echo "scale=2; ( $NewLight - $CurrentBrightness ) / $LevelSteps" | bc ))
# Step once per Screen Hz to make animation
for i in $(eval echo {1..$LevelSteps} )