简体   繁体   English

输出格式应按照科学计数法

[英]Out put format should be according to scientific notation

In my program I am calculating large number of values and I want to write the calculated values according to scientific notation as an example it should be as follow. 在我的程序中,我正在计算大量值,并且我想根据科学计数法写出计算值,例如,它应如下所示。

0.16200000000    should be   1.6200000000e-01
6.09756097560    should be   6.0975609756e+00

Which function results this out put. 哪个函数可以输出结果。

'%e' % (number)

The %e format specifier is the specifier for scientific notations. %e格式说明符是科学计数法的说明符。 Find out more here: https://docs.python.org/2/library/string.html 在此处了解更多信息: https : //docs.python.org/2/library/string.html

'%.10e' % (your value) '%.10e'%(您的值)

This is the easiest way to convert in to scientific notation. 这是转换为科学计数法的最简单方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python科学符号格式 - Python Scientific Notation Format 以科学记数法的形式显示数组 - Show an array in format of scientific notation Python float to string(科学记数法),特定格式 - Python float to string (scientific notation), in specific format 如何控制 Python 格式字符串中科学记数法的确切格式? - How to control the exact format of scientific notation in a Python format string? 如何将数字格式从科学记数法转换为数字 python? - How To Convert Number format from Scientific Notation to Number python? 使用科学计数法时Matplotlib色条刻度格式 - Matplotlib colorbar ticks format when using scientific notation 字符串格式:以0开头的科学计数法表示正数,以-开头。 负数 - String format: Start scientific notation with 0. for positive number, with -. for negative number python sm.ols 更改摘要格式以避免科学记数法 - python sm.ols change format of summary to avoid scientific notation 将浮点数转换为位置格式的字符串(没有科学记数法和错误精度) - Convert float to string in positional format (without scientific notation and false precision) 格式化/抑制 Pandas 聚合结果的科学记数法 - Format / Suppress Scientific Notation from Pandas Aggregation Results
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM