Skip to content

Commit

Permalink
feat: add description for our new usage of printf
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Apr 4, 2024
1 parent 91c20a0 commit f3182cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 01-constants-and-variables/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ func main() {
fmt.Printf("z = %f\n", z)
fmt.Printf("z = %.10f\n", z)
fmt.Printf("z = %g\n", z)
// printf allows you to specify the precision using a parameter
// (that precedes the value) if you use a .* as the precision
// in the format tag.
fmt.Printf("z = %.*f", 12, z)
}

0 comments on commit f3182cc

Please sign in to comment.