在shell 脚本中,可以使用 bc 命令将字符串转换为浮点数。 下面是一个示例: #!/bin/bash string="1.23" result=$(echo "scale=2; $string" | bc) echo $result 复制 ...
確定! 回上一頁