Search This Blog

Shell script: arithmetic float point


  # 2/3
  echo "2/3" | bc -l


  # 0.67
  printf "%3.2f" $(echo "2/3" | bc -l)

No comments:

Post a Comment