From b1d01d8ae7115eac92866d71a614a14bb3333650 Mon Sep 17 00:00:00 2001 From: Mia Date: Wed, 23 Feb 2022 11:29:23 -0500 Subject: [PATCH] adjust sub to remove leading 0s that should not be present --- subtraction/sub | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subtraction/sub b/subtraction/sub index 72d9a44..e21b79f 100755 --- a/subtraction/sub +++ b/subtraction/sub @@ -115,5 +115,6 @@ borrow(){ f1="$next" done } - echo "${nr}$o" # $nr is for negative handling + [ "${o%%.*}" -ne 0 ] && o="${o#0}" + echo "${nr}${o}" # $nr is for negative handling } || echo $(($1-$2)) # NOT float