Forward-port raw_convert precision parameter from v0.
authorCarl Hetherington <cth@carlh.net>
Thu, 26 Jun 2014 15:06:33 +0000 (16:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 26 Jun 2014 15:06:33 +0000 (16:06 +0100)
src/raw_convert.h

index 37cddbf07cfd26db5e6275434fdaa04727915e93..fe847c903d2c3801f03c76ecaa6e715d5759b7dd 100644 (file)
@@ -27,11 +27,11 @@ namespace dcp {
  */
 template <typename P, typename Q>
 P
-raw_convert (Q v)
+raw_convert (Q v, int precision = 16)
 {
        std::stringstream s;
        s.imbue (std::locale::classic ());
-       s << std::setprecision (16);
+       s << std::setprecision (precision);
        s << v;
        P r;
        s >> r;