2020-09-25 16:47:55 +00:00
|
|
|
# print 'n' with enough leading spaces to be right-justified in 'width'
|
|
|
|
fn print-int32-decimal-right-justified screen: (addr screen), n: int, _width: int {
|
2020-09-22 17:13:35 +00:00
|
|
|
# tweak things for negative numbers
|
2020-10-13 02:00:16 +00:00
|
|
|
var n-width/eax: int <- decimal-size n
|
|
|
|
var width/ecx: int <- copy _width
|
2020-09-22 07:27:56 +00:00
|
|
|
{
|
2020-09-25 16:47:55 +00:00
|
|
|
compare n-width, width
|
2020-09-22 07:27:56 +00:00
|
|
|
break-if->=
|
2021-11-09 16:12:11 +00:00
|
|
|
print-code-point-utf8 screen, 0x20/space
|
2020-09-25 16:47:55 +00:00
|
|
|
width <- decrement
|
2020-09-22 07:27:56 +00:00
|
|
|
loop
|
|
|
|
}
|
|
|
|
print-int32-decimal screen, n
|
|
|
|
}
|