diff --git a/jsonapi.go b/jsonapi.go index ec66454c6..37a14c121 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -781,11 +781,11 @@ func JSONToAmount(jsonAmount float64) (int64, error) { var amount int64 var err error if jsonAmount > 1.797693134862315708145274237317043567981e+300 { - err := fmt.Errorf("Error %d is too large to convert", jsonAmount) + err := fmt.Errorf("Error %v is too large to convert", jsonAmount) return amount, err } if jsonAmount < -1.797693134862315708145274237317043567981e+300 { - err := fmt.Errorf("Error %d is too small to convert", jsonAmount) + err := fmt.Errorf("Error %v is too small to convert", jsonAmount) return amount, err } tempVal := 1e8 * jsonAmount diff --git a/jsonapi_test.go b/jsonapi_test.go index 74f7bc7b1..db8aa9ed6 100644 --- a/jsonapi_test.go +++ b/jsonapi_test.go @@ -287,11 +287,11 @@ func TestJSONtoAmount(t *testing.T) { res, err := btcjson.JSONToAmount(tt.in) if tt.pass { if res != tt.out || err != nil { - t.Errorf("Should not fail: ", tt.in) + t.Errorf("Should not fail: %v", tt.in) } } else { if err == nil { - t.Errorf("Should not pass: ", tt.in) + t.Errorf("Should not pass: %v", tt.in) } } }