From 97f5151099967e6c823d640a90d87bca92c44035 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 29 Oct 2019 03:00:39 +0000 Subject: CTAN sync 201910290300 --- dviware/dvisvgm/src/XMLString.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'dviware/dvisvgm/src/XMLString.cpp') diff --git a/dviware/dvisvgm/src/XMLString.cpp b/dviware/dvisvgm/src/XMLString.cpp index b07e0e287b..fcafb8d1ee 100644 --- a/dviware/dvisvgm/src/XMLString.cpp +++ b/dviware/dvisvgm/src/XMLString.cpp @@ -21,6 +21,7 @@ #include #include #include "Unicode.hpp" +#include "utility.hpp" #include "XMLString.hpp" using namespace std; @@ -89,17 +90,8 @@ XMLString::XMLString (double x) { } if (std::abs(x) < 1e-6) x = 0; - assign(to_string(x)); - size_t pos = find('.'); - if (pos != string::npos) { - pos = find_last_not_of('0'); - if (pos != string::npos) { - erase(pos+1); // remove trailing zeros - if (at(length()-1) == '.') - pop_back(); // remove trailing dot - } - } - pos = find("0."); + assign(util::to_string(x)); + size_t pos = find("0."); if (pos != string::npos && (pos == 0 || at(pos-1) == '-')) erase(pos, 1); } -- cgit v1.2.3