Compare commits

..

2 commits

Author SHA1 Message Date
Dovydas
4f9175c00f
Merge acffc5529c into 57a340d853 2024-02-18 12:57:03 +00:00
david
acffc5529c adjust comment 2024-02-18 14:56:51 +02:00

View file

@ -129,9 +129,10 @@ func NewFromBigInt(value *big.Int, exp int32) Decimal {
// //
// Example: // Example:
// //
// d1, err := NewFromBigRat(big.NewRat(0, 1), 4) // d1 := NewFromBigRat(big.NewRat(0, 1), 0) // output: "0"
// d2, err := NewFromBigRat(big.NewRat(4, 5), 100) // d2 := NewFromBigRat(big.NewRat(4, 5), 1) // output: "0.8"
// d3, err := NewFromBigRat(big.NewRat(10000, 3), 300) // d3 := NewFromBigRat(big.NewRat(1000, 3), 3) // output: "333.333"
// d4 := NewFromBigRat(big.NewRat(2, 7), 4) // output: "0.2857"
// //
func NewFromBigRat(value *big.Rat, precision int32) Decimal { func NewFromBigRat(value *big.Rat, precision int32) Decimal {
return Decimal{ return Decimal{