From 1d5f8d5a5267710f247c85f31ed8ba7949df37f7 Mon Sep 17 00:00:00 2001 From: Fritz Mueller Date: Wed, 4 Sep 2019 02:06:18 -0700 Subject: [PATCH] Use default format to render FloatLiteral (#717) Fixes https://github.com/esphome/issues/issues/557 --- esphome/cpp_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/cpp_generator.py b/esphome/cpp_generator.py index c1e4a87179..09b542b3cc 100644 --- a/esphome/cpp_generator.py +++ b/esphome/cpp_generator.py @@ -250,7 +250,7 @@ class FloatLiteral(Literal): def __str__(self): if math.isnan(self.float_): return u"NAN" - return u"{:f}f".format(self.float_) + return u"{}f".format(self.float_) # pylint: disable=bad-continuation