mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 07:50:00 +00:00
Fixed description to decimal and scientific notation
This commit is contained in:
@@ -45,9 +45,10 @@ pub fn main() void {
|
||||
// conversion of 0.453592 kg to the pound.
|
||||
const shuttle_weight: f16 = 0.453592 * 4480e3;
|
||||
|
||||
// By default, float values are formatted in scientific
|
||||
// notation. Try experimenting with '{d}' and '{d:.3}' to see
|
||||
// how decimal formatting works.
|
||||
// By default, float values are formatted in standard decimal
|
||||
// notation. Experiment with '{d}' and '{d:.3}' to see how
|
||||
// decimal formatting works, or try '{e}' and '{e:.3}' for
|
||||
// scientific notation.
|
||||
print("Shuttle liftoff weight: {d:.0} metric tons\n", .{shuttle_weight / 1e3});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user