コード例 #1
0
ファイル: parameter.go プロジェクト: TMaYaD/clif
// Float representation of the value (will be 0.0, if not given or not parsable)
func (this *parameter) Float() float64 {
	if this.Values == nil {
		return 0
	} else {
		return reflekt.AsFloat(this.Values[0])
	}
}
コード例 #2
0
ファイル: parameter.go プロジェクト: TMaYaD/clif
// Floats returns values as float64 array (values will be 0.0, if not parsable to float64)
func (this *parameter) Floats() []float64 {
	if this.Values == nil {
		return nil
	} else {
		res := make([]float64, this.Count())
		for i, v := range this.Values {
			res[i] = reflekt.AsFloat(v)
		}
		return res
	}
}