1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin,strconv: fix and optimize utf8 and formatting functions (#9874)

This commit is contained in:
penguindark
2021-04-25 16:57:21 +02:00
committed by GitHub
parent 3c8d2bbaec
commit bfe0a7887f
4 changed files with 37 additions and 16 deletions

View File

@ -110,6 +110,14 @@ fn (d Dec64) get_string_64(neg bool, i_n_digit int, i_pad_digit int) string {
x++
}
// no decimal digits needed, end here
if i_n_digit == 0 {
unsafe {
buf[i]=0
return tos(byteptr(&buf[0]), i)
}
}
if out_len >= 1 {
buf[y - x] = `.`
x++