code: func (a int64Amount) AsCanonicalBytes(out []byte) (result []byte, exponent int32) {
  	mantissa := a.value
  	exponent = int32(a.scale)
  
  	amount, times := removeInt64Factors(mantissa, 10)
  	exponent += int32(times)
  
  	// make sure exponent is a multiple of 3
  	var ok bool
  	switch exponent % 3 {
  	case 1, -2:
  		amount, ok = int64MultiplyScale10(amount)
  		if !ok {
  			return infDecAmount{a.AsDec()}.AsCanonicalBytes(out)
  		}
  		exponent = exponent - 1
  	case 2, -1:
  		amount, ok = int64MultiplyScale100(amount)
  		if !ok {
  			return infDecAmount{a.AsDec()}.AsCanonicalBytes(out)
  		}
  		exponent = exponent - 2
  	}
  	return strconv.AppendInt(out, amount, 10), exponent
  }
docs: // AsCanonicalBytes accepts a buffer to write the base-10 string value of this field to, and returns
  // either that buffer or a larger buffer and the current exponent of the value. The value is adjusted
  // until the exponent is a multiple of 3 - i.e. 1.1e5 would return "110", 3.