iostreams - removing leading zeros and controlling exponent field width

A

Anjo Gasa

I have a couple questions regarding iostreams output. I just finished
searching the group archive and don't believe they have been
specifically address before.

1. How can one remove leading zero's from floating numbers. For
example, consider this output: 0.2956097. Are there any manipulators
that will set a stream to output .2956097 instead, removing the
leading zero?

2. How can one control the width of the exponent field. For example,
consider the following output: 3.1682894E-009. Are there any
manipulators that will set a stream to output the exponent as "E-09"
instead of "E-009".

Anjo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top