切り捨て・切り上げ・四捨五入切り捨てINT=$(echo 2.1 | perl -ne 'print int($_)') && echo $INT # "2" 四捨五入INT=$(echo 1.5 | perl -ne 'print int($_ + 0.5)') && echo $INT # "2" 参考http://stackoverflow.com/questions/178539/how-do-you-round-a-floating-point-number-in-perl |
|