func (c NumberArrayCollection) Min(key ...string) decimal.Decimal {
	var smallest = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		if i == 0 {
			smallest = c.value[i]
			continue
		}
		if smallest.GreaterThan(c.value[i]) {
			smallest = c.value[i]
		}
	}
	return smallest
}
Min returns the minimum value of a given key.
package collection
import (
	"encoding/json"
	"github.com/shopspring/decimal"
	"math"
	"math/rand"
	"time"
)
type NumberArrayCollection struct {
	value []decimal.Decimal
	BaseCollection
}
func (c NumberArrayCollection) Sum(key ...string) decimal.Decimal {
	var sum = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		sum = sum.Add(c.value[i])
	}
	return sum
}
func (c NumberArrayCollection) Length() int {
	return len(c.value)
}
func (c NumberArrayCollection) Avg(key ...string) decimal.Decimal {
	var sum = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		sum = sum.Add(c.value[i])
	}
	return sum.Div(nd(len(c.value)))
}