0

How to force output to be in standard notation instead of scientific notation in C++ .

like .00001 and not like 1e-6

24th Apr 2018, 5:40 AM
Elliot
Elliot - avatar
4 Answers
+ 5
Use printf with '%f' format: #include <iostream> #include <cstdio> int main() { double d{1e-6}; printf("Value of d = %f", d); return 0; } http://www.cplusplus.com/reference/cstdio/printf/
24th Apr 2018, 6:18 AM
Ipang
+ 1
thanks.
24th Apr 2018, 7:18 AM
Elliot
Elliot - avatar
0
👍👍
24th Apr 2018, 8:59 AM
Elliot
Elliot - avatar