fmt: format '1.' to '1.0' (#11312)
parent
714fa3215c
commit
b635ff80de
|
@ -549,6 +549,9 @@ pub fn (mut f Fmt) expr(node ast.Expr) {
|
|||
}
|
||||
ast.FloatLiteral {
|
||||
f.write(node.val)
|
||||
if node.val.ends_with('.') {
|
||||
f.write('0')
|
||||
}
|
||||
}
|
||||
ast.GoExpr {
|
||||
f.go_expr(node)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
a := 1.0
|
||||
println(a)
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
a := 1.
|
||||
println(a)
|
||||
}
|
Loading…
Reference in New Issue