diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-21 13:00:36 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-03-21 13:00:36 +0100 |
commit | 757a29d0137b974fff6ddcc945d76e69ae120ecb (patch) | |
tree | 1fff46951e30eeae0402e99070e60901bd104eea /src/common/conversion.cpp | |
parent | 12e3713e7705e4353d306ae2ec03abfe8fcd5f55 (diff) |
Diffstat (limited to 'src/common/conversion.cpp')
-rw-r--r-- | src/common/conversion.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/common/conversion.cpp b/src/common/conversion.cpp deleted file mode 100644 index b016537..0000000 --- a/src/common/conversion.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "conversion.hpp" - -#include <math.h> -#include <stdlib.h> - -namespace common -{ - -common::UniquePtr<common::String> doubleToStr(double num, unsigned int width, - unsigned int precision) -{ - auto str = common::make_unique<common::String>(width + precision); - - dtostrf(num, static_cast<signed char>(width), static_cast<unsigned char>(precision), - str->c_str); - - return str; -} - -common::UniquePtr<common::String> intToStr(int num) -{ - auto width = static_cast<unsigned int>(log10(num)); - - auto str = common::make_unique<common::String>(width + 1U); - - dtostrf(num, static_cast<signed char>(width + 1U), 0U, str->c_str); - - return str; -} - -common::UniquePtr<common::String> uintToStr(unsigned int num) -{ - auto width = static_cast<unsigned int>(log10(num)); - - auto str = common::make_unique<common::String>(width + 1U); - - dtostrf(num, static_cast<signed char>(width + 1U), 0U, str->c_str); - - return str; -} - -} // namespace common |