Added decimal rounding

This commit is contained in:
William Davis 2024-01-02 23:04:45 -05:00
parent 1942c48b48
commit d61e8aefc3
No known key found for this signature in database

View File

@ -20,6 +20,7 @@ fn main() {
Ok(num) => num,
Err(_) => continue,
};
println!("{}℉ is {}", input, convert(input));
println!("{}°F is {:.2}°C", input, convert(input)); //Prints the conversion
//and rounds to 2 decimals
}
}