mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: string interpolation: binary format support (#11421)
This commit is contained in:
@ -252,6 +252,10 @@ fn (data StrIntpData) get_fmt_format(mut sb strings.Builder) {
|
||||
}
|
||||
strconv.format_dec_sb(abs64(d), bf, mut sb)
|
||||
} else {
|
||||
// binary, we use 3 for binary
|
||||
if base == 3 {
|
||||
base = 2
|
||||
}
|
||||
mut hx := strconv.format_int(d, base)
|
||||
if upper_case {
|
||||
tmp := hx
|
||||
@ -287,6 +291,10 @@ fn (data StrIntpData) get_fmt_format(mut sb strings.Builder) {
|
||||
}
|
||||
strconv.format_dec_sb(d, bf, mut sb)
|
||||
} else {
|
||||
// binary, we use 3 for binary
|
||||
if base == 3 {
|
||||
base = 2
|
||||
}
|
||||
mut hx := strconv.format_uint(d, base)
|
||||
if upper_case {
|
||||
tmp := hx
|
||||
|
Reference in New Issue
Block a user