Menu

Log double with precision

Help
Jaws
2011-03-17
2013-06-03
  • Jaws

    Jaws - 2011-03-17

    Hi,
    I am logging some double data using the async_log example as type of log and then  putting data as:
    BOOST_LOG(lg)<<dataDouble1<<";"dataDouble2;
    I was not able to set the precision of the double data. I would like for example to have a format like %8.8f.ù
    How can I do?
    Thanks
    J

     
  • Andrey Semashev

    Andrey Semashev - 2011-03-17

    You have several alternatives. First, you're free to use standard manipulators like std::setprecision and std::setw. Second, you can use Boost.Format (www.boost.org) and specify with and precision in printf-like style.

     

Log in to post a comment.

MongoDB Logo MongoDB