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.
输入
CTCF_1276 4.006055058150985e-03 CTCF_1274 1.726979566495019e-02
输出
CTCF_1276 4.00606e-03 CTCF_1274 1.72698e-02
我知道awk可以很容易地做到这一点,但我不喜欢它,因为%.5e如果我想从 python 调用它,我需要转义字符串中的 。有没有人有更好的方法来做到这一点?
awk
%.5e
重击:
printf '%.5e' 4.006055058150985e-03
Python:
print('{:.5e}'.format(4.006055058150985e-03))
perl:
printf '%.5e', 4.006055058150985e-03
awk: