...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::cnv::strtol cnv; BOOST_TEST( "12.3" == convert<string>(12.3456, cnv(arg::precision = 1)).value()); BOOST_TEST( "12.35" == convert<string>(12.3456, cnv(arg::precision = 2)).value()); BOOST_TEST("12.346" == convert<string>(12.3456, cnv(arg::precision = 3)).value()); BOOST_TEST( "-12.3" == convert<string>(-12.3456, cnv(arg::precision = 1)).value()); BOOST_TEST( "-12.35" == convert<string>(-12.3456, cnv(arg::precision = 2)).value()); BOOST_TEST("-12.346" == convert<string>(-12.3456, cnv(arg::precision = 3)).value());