func (d Decimal) DivRound(d2 Decimal, precision int32) Decimal {
	dec := Decimal{decimal: d.decimal.DivRound(d2.decimal, precision)}
	p := strconv.Itoa(int(precision))

	var vars, formula string
	if d.parens {
		vars += divRound + leftParen + p + rightParen + leftParen + leftParen + d.vars + rightParen + div
		formula += divRound + leftParen + p + rightParen + leftParen + leftParen + d.formula + rightParen + div
	} else {
		vars += divRound + leftParen + p + rightParen + leftParen + d.vars + div
		formula += divRound + leftParen + p + rightParen + leftParen + d.formula + div
	}

	if d2.parens {
		vars += leftParen + d2.vars + rightParen + rightParen
		formula += leftParen + d2.formula + rightParen + rightParen
	} else {
		vars += d2.vars + rightParen
		formula += d2.formula + rightParen
	}

	dec.vars = vars
	dec.formula = formula

	return dec
}
// DivRound divides and rounds to a given precision
// i.e. to an integer multiple of 10^(-precision)
//   for a positive quotient digit 5 is rounded up, away from 0
//   if the quotient is negative then digit 5 is rounded down, away from 0
// Note that precision<0 is allowed as input.
DivRound divides and rounds to a given precision
i.e. to an integer multiple of 10^(-precision)
for a positive quotient digit 5 is rounded up, away from 0
if the quotient is negative then digit 5 is rounded down, away from 0
Note that precision<0 is allowed as input.
// DivRound divides and rounds to a given precision // i . e . to an integer multiple of 10^ ( - precision ) // for a positive quotient digit 5 is rounded up away from 0 // if the quotient is negative then digit 5 is rounded down away from 0 // Note that precision<0 is allowed as input .
func (d Decimal) DivRound(d2 Decimal, precision int32) Decimal {
	dec := Decimal{decimal: d.decimal.DivRound(d2.decimal, precision)}
	p := strconv.Itoa(int(precision))
	var vars, formula string
	if d.parens {
		vars += divRound + leftParen + p + rightParen + leftParen + leftParen + d.vars + rightParen + div
		formula += divRound + leftParen + p + rightParen + leftParen + leftParen + d.formula + rightParen + div
	} else {
		vars += divRound + leftParen + p + rightParen + leftParen + d.vars + div
		formula += divRound + leftParen + p + rightParen + leftParen + d.formula + div
	}
	if d2.parens {
		vars += leftParen + d2.vars + rightParen + rightParen
		formula += leftParen + d2.formula + rightParen + rightParen
	} else {
		vars += d2.vars + rightParen
		formula += d2.formula + rightParen
	}
	dec.vars = vars
	dec.formula = formula
	return dec
}
func ( d Decimal ) DivRound ( d2 Decimal , precision int32 ) Decimal { dec := Decimal { decimal : d . decimal . DivRound ( d2 . decimal , precision ) } p := strconv . Itoa ( int ( precision ) ) var vars , formula string if d . parens { vars += divRound + leftParen + p + rightParen + leftParen + leftParen + d . vars + rightParen + div formula += divRound + leftParen + p + rightParen + leftParen + leftParen + d . formula + rightParen + div } else { vars += divRound + leftParen + p + rightParen + leftParen + d . vars + div formula += divRound + leftParen + p + rightParen + leftParen + d . formula + div } if d2 . parens { vars += leftParen + d2 . vars + rightParen + rightParen formula += leftParen + d2 . formula + rightParen + rightParen } else { vars += d2 . vars + rightParen formula += d2 . formula + rightParen } dec . vars = vars dec . formula = formula return dec }
DivRound divides and rounds to a given precision
i.e.
DivRound divides and rounds to a given precision i . e .