summaryrefslogtreecommitdiff
path: root/src/utils/general.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-02-14 10:11:32 +0100
committerHampusM <hampus@hampusmat.com>2022-02-14 10:11:32 +0100
commit7892ef9d248c189be68ce7faf63230ec0a318b67 (patch)
tree7c3d07779d5ce96994f81c0cc22e8b667601ee9d /src/utils/general.hpp
parenta03dfe959fcafd238119bdf7f27c07b92064496e (diff)
refactor: reorganize & add debugging
Diffstat (limited to 'src/utils/general.hpp')
-rw-r--r--src/utils/general.hpp23
1 files changed, 23 insertions, 0 deletions
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<SmartString> floatToStr(
+ float num,
+ unsigned int width = 3,
+ unsigned int precision = 2
+);