Kommenterat mer och lagt in exit 0
This commit is contained in:
parent
b1f3b46a49
commit
c6980a21bf
@ -11,6 +11,7 @@ Rate="6.3"
|
||||
printf "Do you want to convert from SEK or USD? "
|
||||
read Exchange
|
||||
|
||||
# Check our input
|
||||
if [ "$Exchange" != "USD" ] && [ $Exchange != "SEK" ]; then
|
||||
echo "Enter USD or SEK"
|
||||
exit 2
|
||||
@ -19,6 +20,7 @@ fi
|
||||
printf "Enter amount: "
|
||||
read Amount
|
||||
|
||||
# Case-statement in case we want other current in the future
|
||||
case "$Exchange" in
|
||||
USD)
|
||||
Answer=`echo "scale=2;$Amount*$Rate" | bc`
|
||||
@ -30,3 +32,5 @@ case "$Exchange" in
|
||||
printf "$Amount SEK is $Answer USD\n"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user