Lines Matching refs:digs
105 var digs decimalSlice
114 digs.d = buf[:]
115 ok = f.ShortestDecimal(&digs, &lower, &upper)
122 prec = max(digs.nd-1, 0)
124 prec = max(digs.nd-digs.dp, 0)
126 prec = digs.nd
143 digs.d = buf[:]
145 ok = f.FixedDecimal(&digs, digits)
151 return formatDigits(dst, shortest, neg, digs, prec, fmt)
159 var digs decimalSlice
163 digs = decimalSlice{d: d.d[:], nd: d.nd, dp: d.dp}
167 prec = digs.nd - 1
169 prec = max(digs.nd-digs.dp, 0)
171 prec = digs.nd
186 digs = decimalSlice{d: d.d[:], nd: d.nd, dp: d.dp}
188 return formatDigits(dst, shortest, neg, digs, prec, fmt)
191 func formatDigits(dst []byte, shortest bool, neg bool, digs decimalSlice, prec int, fmt byte) []byte {
194 return fmtE(dst, neg, digs, prec, fmt)
196 return fmtF(dst, neg, digs, prec)
200 if eprec > digs.nd && digs.nd >= digs.dp {
201 eprec = digs.nd
209 exp := digs.dp - 1
211 if prec > digs.nd {
212 prec = digs.nd
214 return fmtE(dst, neg, digs, prec-1, fmt+'e'-'g')
216 if prec > digs.dp {
217 prec = digs.nd
219 return fmtF(dst, neg, digs, max(prec-digs.dp, 0))