decimal
decimal copied to clipboard
output 0
v1, _ := decimal.NewFromString("1") v2, _ := decimal.NewFromString("1000000000000000000") fmt.Println(v1.Div(v2))
The API isn't clear here.
Div uses DivRound underneath, so you can pass in 18 as precision to get your desired result.