mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 07:50:00 +00:00
exercise 60: added hint on correct format
This commit is contained in:
@@ -49,6 +49,8 @@ pub fn main() void {
|
|||||||
// notation. Experiment with '{d}' and '{d:.3}' to see how
|
// notation. Experiment with '{d}' and '{d:.3}' to see how
|
||||||
// decimal formatting works, or try '{e}' and '{e:.3}' for
|
// decimal formatting works, or try '{e}' and '{e:.3}' for
|
||||||
// scientific notation.
|
// scientific notation.
|
||||||
|
// NOTE: The weight of the shuttle is a huge number, a scientific notation
|
||||||
|
// may be more appropriate.
|
||||||
print("Shuttle liftoff weight: {d:.0} metric tons\n", .{shuttle_weight / 1e3});
|
print("Shuttle liftoff weight: {d:.0} metric tons\n", .{shuttle_weight / 1e3});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user