(gasPrice *big.Int)
| 158 | } |
| 159 | |
| 160 | func fmtGwei(gasPrice *big.Int) string { |
| 161 | // if gasPrice lower than 1 Gwei, show in decimal |
| 162 | if gasPrice.Cmp(big.NewInt(params.GWei)) < 0 { |
| 163 | f := new(big.Float).SetPrec(236) |
| 164 | f.SetMode(big.ToNearestEven) |
| 165 | f.Quo(f.SetInt(gasPrice), big.NewFloat(params.GWei)) |
| 166 | return fmt.Sprintf("%.9f", f) |
| 167 | } |
| 168 | // otherwise show in integer |
| 169 | return fmt.Sprintf("%d", new(big.Int).Div(gasPrice, big.NewInt(params.GWei))) |
| 170 | } |
no outgoing calls
no test coverage detected