mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 04:50:29 +00:00
Merge pull request #6391 from mtarik34b/duration-unit-spacing
Add formatting flag for space between time.Duration and unit of measurement
This commit is contained in:
@@ -2592,11 +2592,19 @@ fmt_named_buitlin_custom_formatters :: proc(fi: ^Info, v: any, verb: rune, info:
|
||||
prec = 6
|
||||
buf[w] = 'm'
|
||||
}
|
||||
if fi.space {
|
||||
w -= 1
|
||||
buf[w] = ' '
|
||||
}
|
||||
w, u = ffrac(buf[:w], u, prec)
|
||||
w = fint(buf[:w], u)
|
||||
} else {
|
||||
w -= 1
|
||||
buf[w] = 's'
|
||||
if fi.space {
|
||||
w -= 1
|
||||
buf[w] = ' '
|
||||
}
|
||||
w, u = ffrac(buf[:w], u, 9)
|
||||
w = fint(buf[:w], u%60)
|
||||
u /= 60
|
||||
|
||||
Reference in New Issue
Block a user