zero pad decimal part of average guesses
An average of 3.04 was shown as 3.4 because the hundredths weren't padded. Pad with parameter expansion to keep the script bash-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f29d81e932
commit
8dfebaa9f8
1 file changed
+1
@@ -484,6 +484,7 @@ function update_stats() {
|
|||||||
integer_part=$(( result / 100 ))
|
integer_part=$(( result / 100 ))
|
||||||
decimal_part=$(( result % 100 ))
|
decimal_part=$(( result % 100 ))
|
||||||
|
|
||||||
|
[[ ${decimal_part} -lt 10 ]] && decimal_part="0${decimal_part}"
|
||||||
AVERAGE="${integer_part}.${decimal_part}"
|
AVERAGE="${integer_part}.${decimal_part}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user