time_value=$(($large / 1000))
$large could be 60 or 57. I'm expecting 57/1000=0.057. But I'm getting 0. So, is there any way to do this?
time_value=$(($large / 1000))
$large could be 60 or 57. I'm expecting 57/1000=0.057. But I'm getting 0. So, is there any way to do this?
try
time_value=$((echo scale=3 ; echo $large / 1000) | bc )
where
scale=3 tell bc to use 3 digit after dot/commaecho $large / 1000 just compute divisionPlease note that, once you set floating point, you have to carry it all over the place.
if $time_value above is bellow 0, it cannot be used in usual $(( )) pattern.