Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

sum decimals bash

a=1.25
b=3.49
sum=$(echo "scale=2; "$a"+"$b| bc -l) #scale defines number of decimals
4.74
 
PREVIOUS NEXT
Tagged: #sum #decimals #bash
ADD COMMENT
Topic
Name
4+6 =