From 5ac1f10b2873ff0798be71a542b091b11e079d8a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 8 Apr 2026 20:42:23 -1000 Subject: [PATCH] Fix clang-tidy braces --- esphome/core/helpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index 48ed45477f..30903e58ca 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -535,12 +535,13 @@ static size_t value_accuracy_to_buf_fast(char *buf, float value, int8_t accuracy value = -value; } uint32_t mult = 1; - if (accuracy_decimals == 1) + if (accuracy_decimals == 1) { mult = 10; - else if (accuracy_decimals == 2) + } else if (accuracy_decimals == 2) { mult = 100; - else if (accuracy_decimals == 3) + } else if (accuracy_decimals == 3) { mult = 1000; + } // Cast to double for the multiply to match snprintf's precision. // float*int loses bits at exact-half boundaries (e.g. 23.45f*10 = 234.5 in float, // but snprintf sees 234.500007... via double promotion and rounds differently).