func (d Decimal) Text() []byte {
	if d.text != nil {
		return d.text
	}

	if d.IsNull() {
		return []byte(textNullDecimal)
	}

	val := d.Value()
	text := ""
	// If the decimal we have is represented by an exact float value, then
	// use that to make the string.  Otherwise we need to turn the big.Int
	// into a string.
	if floatVal, exact := val.Float64(); exact {
		d.text = strconv.AppendFloat(nil, floatVal, 'f', -1, 64)
	} else {
		if val.IsNegative() {
			text = "-"
		}
		text += val.Coefficient().String()
	}

	if exp := val.Exponent(); exp != 0 {
		d.text = append(d.text, []byte(fmt.Sprintf("d%d", exp))...)
	}

	d.text = []byte(text)
	return d.text
}
// Text returns the Decimal in text form.  If no exponent is set,
// then the text form will not include one.  Otherwise the formatted
// text is in the form: <coefficient>d<exponent>
Text returns the Decimal in text form.  If no exponent is set,
then the text form will not include one.  Otherwise the formatted
text is in the form: d
// Text returns the Decimal in text form . If no exponent is set // then the text form will not include one . Otherwise the formatted // text is in the form : <coefficient > d<exponent >
func (d Decimal) Text() []byte {
	if d.text != nil {
		return d.text
	}
	if d.IsNull() {
		return []byte(textNullDecimal)
	}
	val := d.Value()
	text := ""
	if floatVal, exact := val.Float64(); exact {
		d.text = strconv.AppendFloat(nil, floatVal, 'f', -1, 64)
	} else {
		if val.IsNegative() {
			text = "-"
		}
		text += val.Coefficient().String()
	}
	if exp := val.Exponent(); exp != 0 {
		d.text = append(d.text, []byte(fmt.Sprintf("d%d", exp))...)
	}
	d.text = []byte(text)
	return d.text
}
func ( d Decimal ) Text ( ) [ ] byte { if d . text != nil { return d . text } if d . IsNull ( ) { return [ ] byte ( textNullDecimal ) } val := d . Value ( ) text := " " if floatVal , exact := val . Float64 ( ) ; exact { d . text = strconv . AppendFloat ( nil , floatVal , 'f' , - 1 , 64 ) } else { if val . IsNegative ( ) { text = " " } text += val . Coefficient ( ) . String ( ) } if exp := val . Exponent ( ) ; exp != 0 { d . text = append ( d . text , [ ] byte ( fmt . Sprintf ( " " , exp ) ) ... ) } d . text = [ ] byte ( text ) return d . text }
Text returns the Decimal in text form.
Text returns the Decimal in text form .
// If the decimal we have is represented by an exact float value, then // use that to make the string.  Otherwise we need to turn the big.Int // into a string.