Convert int value in float

Caldera Open unix 8 (media only)
February 11, 2010 at 23:26:01
Specs: Windows XP
My problem is connect with unix. I have no idea
to multiply a int value with float value. Please give me any shell program in unix with syntax.


See More: Convert int value in float

Report •

#1
February 12, 2010 at 10:27:50
Since most unix shells do not support float values, you need to use something like awk or bc. Check out this bc link:

http://www.basicallytech.com/blog/i...

#!/bin/ksh

val=$(echo '50*5.25' | bc)
echo $val # equals 262.5


Report •
Related Solutions


Ask Question