package main

import "fmt"

func main() {
	fmt.Println("Left pad numbers")
	fmt.Printf("|%06d|%6d|\n\n", 12, 345)

	fmt.Println("Right pad numbers")
	// NOTE: Right padding with trailing zeros does not work...
	fmt.Printf("|%0-6d|%-6d|\n\n", 12, 345)

	fmt.Println("Use a variable of value 6 to define the width")
	width := 6
	fmt.Printf("|%0*d|\n", width, 12)
	fmt.Printf("|%*d|\n\n", width, 12)

	fmt.Println("Use a variable of value 3 to define the width")
	width = 3
	fmt.Printf("|%0*d|\n", width, 12)
	fmt.Printf("|%*d|", width, 12)
}
