Answers for "float value in bash script"

1

how to store float values in shell script

# x will have value for any operation user does in place of '9/5'
x=`echo | awk "{print 9/5}"`
echo $x
Posted by: Guest on June-01-2021
2

bash float operation

bc -l <<< '10/3' # Fast way
3.33333333333333333333
bc <<< 'scale=2; 10/3' #Define also how many decimals to take in scale
3.33
Posted by: Guest on November-27-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language