package main
import (
"fmt"
)
var integer int64 = 32500
var floatNum float64 = 22000.456
func main() {
// Common way how to print the decimal
// number
fmt.Printf("%d
", integer)
// Always show the sign
fmt.Printf("%+d
", integer)
// Print in other base x -16, o-8, b -2, d - 10
fmt.Printf("%x
", integer)
fmt.Printf("%#x
", integer)
// Padding with leading zeros
fmt.Printf("%010d
", integer)
// Left padding with spaces
fmt.Printf("% 10d
", integer)
// Right padding
fmt.Printf("% -10d
", integer)
// Print floating
// point number
fmt.Printf("%f
", floatNum)
// Floating point number
// with limited precision = 5
fmt.Printf("%.5f
", floatNum)
// Floating point number
// in scientific notation
fmt.Printf("%e
", floatNum)
// Floating point number
// %e for large exponents
// or %f otherwise
fmt.Printf("%g
", floatNum)
}
/*
32500
+32500
7ef4
0x7ef4
0000032500
32500
32500
22000.456000
22000.45600
2.200046e+04
22000.456
*/