Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个代码
codonsnum=$(bc -l <<< "$lengthseq/3")
如何将结果限制为小数点后 3 位?结果是,例如:2.325234985908723我只想要 3 位小数。
2.325234985908723
使用scale
scale
codonsnum=$(bc -l <<< "scale=3;$lengthseq/3")