Fix div function to manage 0 on numerator (#79)

fix #77

Co-authored-by: GoldenKiwi <thibault.dewailly@corp.ovh.com>
This commit is contained in:
Thibault Ayanides 2021-03-23 08:36:36 +01:00 committed by GitHub
parent c50f200c5c
commit 1c1393c7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,10 @@ div() {
local _d=${3:-2}
local _n=0000000000
_n=${_n:0:$_d}
if (($1 == 0)); then
echo "0"
return
fi
if (($2 == 0)); then
echo "N.A"
return