docs: public static String decimalToString( BigDecimal value ) {
          StringBuilder sb = new StringBuilder();
          boolean negate = false;
          // <sigificand-sign> field
          switch (value.signum()) {
              case -1:
                  sb.append('-');
                  negate = true;
                  break;
              case 1:
                  sb.append('1');
                  break;
              default:
                  return "0";
          }
  
          // <exponent-sign>, <exponent-length> and <exponent> fields
          long exponent = value.precision() - value.scale() - 1;
          if (exponent == 0) {
              sb.append('0');
          } else {
              if (negate) exponent = -exponent;
              String exponentField = String.valueOf(Math.abs(exponent));
              int length = exponentField.length();
              char sign = exponent > 0 ? '1' : '-';
              if (exponent < 0) exponentField = negate(exponentField);
              // <exponent-length>
              String lengthField = String.valueOf(length);
              if (negate || exponent < 0) lengthField = negate(lengthField);
              sb.append(sign).append(lengthField).append(' ').append(exponentField);
          }
  
          // <significand>
          if (negate) value = value.negate();
          StringBuilder significand = new StringBuilder(value.unscaledValue().toString());
          removeTralingZeros(significand);
  
          // Append the significand (and the sentinel character)...
          sb.append(negate ? negate(significand).append('A') : significand);
  
          return sb.toString();
      }