diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 18:18:38 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 18:18:38 +0100 |
commit | 01ce0af940bd69c94a2fac8b65219262845cca98 (patch) | |
tree | 97c443782ce1cfba90b205183c8aab1e3edb0bb3 /src/utils/general.hpp | |
parent | cb7a167c7dee2fa1a19bd09ede3bae8b140e79da (diff) |
refactor: clean sewage
Diffstat (limited to 'src/utils/general.hpp')
-rw-r--r-- | src/utils/general.hpp | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/utils/general.hpp b/src/utils/general.hpp index 9ad0655..dbdbdfc 100644 --- a/src/utils/general.hpp +++ b/src/utils/general.hpp @@ -9,15 +9,28 @@ void stop(); /** - * Converts a floating point number to a string. + * Converts a double number to a string. * - * @param num A floating point number - * @param width The desired float width - * @param precision The desired float precision - * @returns The float as a string. + * @param num A double number + * @param width The desired double width + * @param precision The desired double precision + * @returns The double as a string. */ -unique_ptr<SmartString> floatToStr( - float num, - unsigned int width = 3, - unsigned int precision = 2 -); +UniquePtr<SmartString> doubleToStr(double num, unsigned int width = 3, + unsigned int precision = 2); + +/** + * Converts a integer to a string. + * + * @param num A number + * @returns The number as a string. + */ +UniquePtr<SmartString> intToStr(int num); + +/** + * Converts a unsigned integer to a string. + * + * @param num A number + * @returns The number as a string. + */ +UniquePtr<SmartString> uintToStr(unsigned int num); |