aboutsummaryrefslogtreecommitdiff
path: root/src/comfy.odin
diff options
context:
space:
mode:
authorSan Jacobs2023-10-05 21:53:07 +0200
committerSan Jacobs2023-10-05 21:53:07 +0200
commitb6dab385dbf9a626970f3673d345d0e8e6a62e1e (patch)
treea02320e881ca1279e968fbeae38899f223bc9ce9 /src/comfy.odin
parent15361bd995a08b3788b56289ec89dfb80ceac160 (diff)
downloadsatscalc-b6dab385dbf9a626970f3673d345d0e8e6a62e1e.tar.gz
satscalc-b6dab385dbf9a626970f3673d345d0e8e6a62e1e.tar.bz2
satscalc-b6dab385dbf9a626970f3673d345d0e8e6a62e1e.zip
Rudimentary display of actual results
Diffstat (limited to 'src/comfy.odin')
-rw-r--r--src/comfy.odin17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/comfy.odin b/src/comfy.odin
new file mode 100644
index 0000000..e7ef23c
--- /dev/null
+++ b/src/comfy.odin
@@ -0,0 +1,17 @@
+package main
+
+import "core:strings"
+import "core:strconv"
+
+f64_to_cstring :: proc(f: f64) -> cstring {
+ buf: [20]byte
+ result := strconv.ftoa(buf[:], f, 'f', 2, 64)
+
+ if f > 0 {
+ result = string(buf[1:])
+ }
+
+ output : cstring = strings.clone_to_cstring(string(result))
+
+ return output
+} \ No newline at end of file