Skip to content

#fmt handles $.4f incorrectly when the number is round #1874

@bzbarsky

Description

@bzbarsky

Testcase:

use std;
fn main() {
let i = 5.0;
std::io::println(#fmt("hello world %.4f!", i));
}

This should print "hello world 5.0000!" but prints "hello world 5!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions