%e: d.ddddde±d
(buf []byte, fmt byte, d *Decimal, digits []byte)
| 103 | |
| 104 | // %e: d.ddddde±d |
| 105 | func fmtE(buf []byte, fmt byte, d *Decimal, digits []byte) []byte { |
| 106 | adj := int64(d.Exponent) + int64(len(digits)) - 1 |
| 107 | buf = append(buf, digits[0]) |
| 108 | if len(digits) > 1 { |
| 109 | buf = append(buf, '.') |
| 110 | buf = append(buf, digits[1:]...) |
| 111 | } |
| 112 | buf = append(buf, fmt) |
| 113 | var ch byte |
| 114 | if adj < 0 { |
| 115 | ch = '-' |
| 116 | adj = -adj |
| 117 | } else { |
| 118 | ch = '+' |
| 119 | } |
| 120 | buf = append(buf, ch) |
| 121 | return strconv.AppendInt(buf, adj, 10) |
| 122 | } |
| 123 | |
| 124 | // %f: ddddddd.ddddd |
| 125 | func fmtF(buf []byte, d *Decimal, digits []byte) []byte { |
no outgoing calls
no test coverage detected
searching dependent graphs…