Standard library / math/big
big.Int.Format()
Implement fmt.Formatter for integer verbs, prefixes, width and precision. Expected stdout: '0x002a\n'.
Formal Syntax & Structure
go syntaxgo
func (x *Int) Format(s fmt.State, ch rune)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | fmt.State | Text input or formatting/scanning state, according to the signature. |
| ch | rune | Format verb supplied by fmt. |
Return Value
void
No return value; invoked by fmt.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Printf("%#06x\n", big.NewInt(42))}