diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-28 14:11:49 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-28 14:11:49 +0100 |
commit | df251075e5f3b5b54dd1bd272e348d20953fbfc7 (patch) | |
tree | 32a13f9e76c7d95883935da0277cbf649738a990 /src/std | |
parent | 0b91a042813115beca3c386cc7e1861ee4239393 (diff) |
refactor: fix numbers in conversion functions
Diffstat (limited to 'src/std')
-rw-r--r-- | src/std/conversion.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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<SmartString> doubleToStr(double num, unsigned int width, unsigned int { auto str = make_unique<SmartString>(width + precision); - dtostrf(num, static_cast<signed char>(width), precision, str->c_str); + dtostrf(num, static_cast<signed char>(width), static_cast<unsigned char>(precision), + str->c_str); return str; } @@ -15,7 +16,7 @@ UniquePtr<SmartString> intToStr(int num) auto str = make_unique<SmartString>(width + 1U); - dtostrf(num, static_cast<signed char>(width + 1U), 0, str->c_str); + dtostrf(num, static_cast<signed char>(width + 1U), 0U, str->c_str); return str; } @@ -26,7 +27,7 @@ UniquePtr<SmartString> uintToStr(unsigned int num) auto str = make_unique<SmartString>(width + 1U); - dtostrf(num, static_cast<signed char>(width + 1U), 0, str->c_str); + dtostrf(num, static_cast<signed char>(width + 1U), 0U, str->c_str); return str; } |