Input
CTCF_1276 4.006055058150985e-03
CTCF_1274 1.726979566495019e-02
Output
CTCF_1276 4.00606e-03
CTCF_1274 1.72698e-02
I know awk
can do this very easily, but I don't like it because I need to escape the %.5e
in the string if I want to call it from python. Does anyone have better way to do this?
bash:
printf '%.5e' 4.006055058150985e-03
python:
print('{:.5e}'.format(4.006055058150985e-03))
perl:
printf '%.5e', 4.006055058150985e-03
awk:
printf '%.5e', 4.006055058150985e-03
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.