summaryrefslogtreecommitdiff
path: root/stage3/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'stage3/font.c')
-rw-r--r--stage3/font.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/stage3/font.c b/stage3/font.c
index f47c9c9..3bbba86 100644
--- a/stage3/font.c
+++ b/stage3/font.c
@@ -3,6 +3,8 @@
#include "gfx.h"
#include "heap.h"
#include "memory.h"
+#include "math.h"
+
#include "font_builtin.c"
// important: must be a multiple of 2, else code won't work
@@ -197,3 +199,15 @@ void print_hex(u64 x)
print_num(x, 16);
}
+void print_dbl(double d, u8 points)
+{
+ if (d < 0) {
+ print_char('-');
+ d = -d;
+ }
+
+ long i = d;
+ print_dec(i);
+ print_char('.');
+ print_num_pad((d - (double) i) * (double) ipow(10, points), 10, points, '0');
+}