Formatting output
๐ Scenario: You are creating a simple Rust program to display product prices clearly for a small shop.
๐ฏ Goal: Learn how to format output in Rust using println! with placeholders and formatting options.
๐ What You'll Learn
Create a dictionary (HashMap) with product names and prices
Create a variable for a price threshold
Use a loop to print products with prices formatted to 2 decimal places
Print the formatted output lines
๐ก Why This Matters
๐ Real World
Formatting prices clearly is important in shops, invoices, and reports to make numbers easy to read and professional.
๐ผ Career
Many programming jobs require formatting output for user interfaces, reports, or logs, making this skill very useful.
Progress0 / 4 steps