Ensuring that output is always two digits at least

Show "04" instead of just "4".
This commit is contained in:
Nils Winkler
2017-10-24 07:52:25 +02:00
parent 86a87a33b5
commit 629b8522e5
2 changed files with 8 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ battery_percentage(){
COMMAND_OUTPUT="no"
fi
echo ${COMMAND_OUTPUT:--1}
printf "%02d" "${COMMAND_OUTPUT:--1}"
}
battery_charge(){