Files
tendermint/libs/math/fraction.go
Shivani Joshi 78144306dd JSON tests related changes (#4461)
* test functions take time.Now and other minor changes

* updated remaining test files

* Update validation_test.go

* fix typo

* go fmt

* import time

Co-authored-by: Marko <marbar3778@yahoo.com>
2020-02-28 09:57:00 +01:00

18 lines
469 B
Go

package math
import "fmt"
// Fraction defined in terms of a numerator divided by a denominator in int64
// format.
type Fraction struct {
// The portion of the denominator in the faction, e.g. 2 in 2/3.
Numerator int64 `json:"numerator"`
// The value by which the numerator is divided, e.g. 3 in 2/3. Must be
// positive.
Denominator int64 `json:"denominator"`
}
func (fr Fraction) String() string {
return fmt.Sprintf("%d/%d", fr.Numerator, fr.Denominator)
}