From 7892ef9d248c189be68ce7faf63230ec0a318b67 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 10:11:32 +0100 Subject: refactor: reorganize & add debugging --- src/utils/general.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/utils/general.hpp (limited to 'src/utils/general.hpp') diff --git a/src/utils/general.hpp b/src/utils/general.hpp new file mode 100644 index 0000000..9ad0655 --- /dev/null +++ b/src/utils/general.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "memory.hpp" +#include "smart_string.hpp" + +/** + * Stops code execution. + */ +void stop(); + +/** + * Converts a floating point 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. + */ +unique_ptr floatToStr( + float num, + unsigned int width = 3, + unsigned int precision = 2 +); -- cgit v1.2.3-18-g5258