diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index c912de13f..e5aae2499 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -3,6 +3,7 @@ #include #include +#include #include namespace mbgl { @@ -17,7 +18,11 @@ public: {} static std::string pixelRatioDefine(const ProgramParameters& parameters) { - return std::string("#define DEVICE_PIXEL_RATIO ") + std::to_string(parameters.pixelRatio) + "\n"; + std::ostringstream pixelRatioSS; + pixelRatioSS.imbue(std::locale("C")); + pixelRatioSS.setf(std::ios_base::showpoint); + pixelRatioSS << parameters.pixelRatio; + return std::string("#define DEVICE_PIXEL_RATIO ") + pixelRatioSS.str() + "\n"; } static std::string fragmentSource(const ProgramParameters& parameters) {