Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Display an integer in other bases
- i := 5
- strconv.FormatInt(i, 2)
- strconv.FormatUint(i, 2)
- b := true
- strconv.FormatBool(b) // True
- j := 2.5
- strconv.FormatFloat(j, 'E', -1, 32) // 'E' 2.5E+00, 'e' 2.5e00, 'f' 2.5, 'g' 2.5, 'G' 2.5
- // 'g' and 'G' will behave like 'e' and 'E' with large exponents
- // Number of digits, -1 is a special value that returns
- // the minimum number of digits for an exact value
- // Variable size
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement