lotus: Fix print_float
Would print 3.09 as 3.9. Need to add leading 0. Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
This commit is contained in:
parent
1413dfa26e
commit
b192ff0c3e
@ -55,7 +55,7 @@ const float CONV_FACTOR = 3.3f / (1<<12);
|
|||||||
void print_float(float f) {
|
void print_float(float f) {
|
||||||
int digits = (int)f;
|
int digits = (int)f;
|
||||||
int decimals = (int)(f * 100) % 100;
|
int decimals = (int)(f * 100) % 100;
|
||||||
uprintf("%d.%d\n", digits, decimals);
|
uprintf("%d.%02d\n", digits, decimals);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user