From df251075e5f3b5b54dd1bd272e348d20953fbfc7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 28 Feb 2022 14:11:49 +0100 Subject: refactor: fix numbers in conversion functions --- src/std/conversion.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/std/conversion.cpp') diff --git a/src/std/conversion.cpp b/src/std/conversion.cpp index a2a624d..3d75e8a 100644 --- a/src/std/conversion.cpp +++ b/src/std/conversion.cpp @@ -4,7 +4,8 @@ UniquePtr doubleToStr(double num, unsigned int width, unsigned int { auto str = make_unique(width + precision); - dtostrf(num, static_cast(width), precision, str->c_str); + dtostrf(num, static_cast(width), static_cast(precision), + str->c_str); return str; } @@ -15,7 +16,7 @@ UniquePtr intToStr(int num) auto str = make_unique(width + 1U); - dtostrf(num, static_cast(width + 1U), 0, str->c_str); + dtostrf(num, static_cast(width + 1U), 0U, str->c_str); return str; } @@ -26,7 +27,7 @@ UniquePtr uintToStr(unsigned int num) auto str = make_unique(width + 1U); - dtostrf(num, static_cast(width + 1U), 0, str->c_str); + dtostrf(num, static_cast(width + 1U), 0U, str->c_str); return str; } -- cgit v1.2.3-18-g5258