summaryrefslogtreecommitdiff
path: root/src/mbgl/style/expression/value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/expression/value.cpp')
-rw-r--r--src/mbgl/style/expression/value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/style/expression/value.cpp b/src/mbgl/style/expression/value.cpp
index 324fc06f17..7c30c457d8 100644
--- a/src/mbgl/style/expression/value.cpp
+++ b/src/mbgl/style/expression/value.cpp
@@ -1,4 +1,5 @@
#include <mbgl/style/expression/value.hpp>
+#include <sstream>
namespace mbgl {
namespace style {
@@ -38,7 +39,11 @@ std::string stringify(const Value& value) {
return value.match(
[&] (const NullValue&) { return std::string("null"); },
[&] (bool b) { return std::string(b ? "true" : "false"); },
- [&] (float f) { return ceilf(f) == f ? std::to_string((int)f) : std::to_string(f); },
+ [&] (float f) {
+ std::stringstream ss;
+ ss << f;
+ return ss.str();
+ },
[&] (const std::string& s) { return "\"" + s + "\""; },
[&] (const mbgl::Color& c) { return c.stringify(); },
[&] (const std::vector<Value>& arr) {