Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
number format
#2
Code:
Copy      Help
double d=6.56166e-002
str s

s=d
out s

s.format("%g" d)
out s

s.format("%.3g" d)
out s

s.format("%.3f" d)
out s

s.format("%e" d)
out s

s.format("%.3e" d)
out s

%e - with e
%f - without e
%g - with or without e, whichever is more compact


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)