aboutsummaryrefslogtreecommitdiff
path: root/src/comfy.odin
blob: e7ef23c7a586d17fe21453fad0c06aad72054926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}