diff options
author | San Jacobs | 2023-10-05 21:53:07 +0200 |
---|---|---|
committer | San Jacobs | 2023-10-05 21:53:07 +0200 |
commit | b6dab385dbf9a626970f3673d345d0e8e6a62e1e (patch) | |
tree | a02320e881ca1279e968fbeae38899f223bc9ce9 /src/comfy.odin | |
parent | 15361bd995a08b3788b56289ec89dfb80ceac160 (diff) | |
download | satscalc-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.odin | 17 |
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 |