Nguyễn Hương Chà
New member
How do you round off in bash?
Answer
Set the price beforehand with the environment variable PRICE=
<val>
.
</val>
Answer
Set the price beforehand with the environment variable PRICE=
<val>
.
</val>
- Then call the awk – $PRICE will go into awk as an awk variable price .
- It is then rounded up to the nearest 100th with +. 005.
- The printf formatting option %. 2f limits the scale to two decimal places.