Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMarkS

Posted 27 December 2012 - 11:42 AM

You can, for example, set the number of digits to be printed after the decimal in a floating point number. You can set the number of leading/trailing zeros in a number. You can print anything in hexadecimal without writing a conversion function. You can choose to print in decimal or scientific notation. The list goes on. I've searched, and I cannot find this ability in any C++ stream. Maybe I haven't searched well enough?

 

[edit]

 

Well, what do you know...

 

http://www.cplusplus.com/reference/ios/ios_base/fmtflags/

 

How did I miss this?


#1MarkS

Posted 27 December 2012 - 11:40 AM

You can, for example, set the number of digits to be printed after the decimal in a floating point number. You can set the number of leading/trailing zeros in a number. You can print anything in hexadecimal without writing a conversion function. You can choose to print in decimal or scientific notation. The list goes on. I've searched, and I cannot find this ability in any C++ stream. Maybe I haven't searched well enough?


PARTNERS