Browse - programming tips - float to int in bashDate: 2008jan4 Q. How do I convert a floating point number into an integer in bash? A. Use the powerful ${} construct: #!/bin/sh FLOAT=1234.567 INT=${FLOAT/\.*} echo $INT We replace dot and all that follows it with nothing. Notice that this truncates (does not round). Add a commentSign in to add a comment |