docs: public static BigDecimal stringToDecimal( String value ) {
          assert value != null;
          assert value.length() != 0;
          if ("0".equals(value)) return BigDecimal.ZERO;
  
          boolean negate = false;
          if (value.charAt(0) == '-') {
              // Negative, so remove the trailing sentinel ...
              assert value.charAt(value.length() - 1) == 'A';
              value = value.substring(0, value.length() - 1);
              negate = true;
          }
  
          // <exponent-sign>, <exponent-length> and <exponent> fields
          long exponent = 0L;
          boolean negateExponent = false;
          int endIndex = 0;
          switch (value.charAt(1)) {
              case '0':
                  value = value.substring(2);
                  break;
              case '-':
                  negateExponent = true;
                  // $FALL-THROUGH$
              case '1':
              default:
                  // Read in the <exponent-length>
                  int indexOfSpace = value.indexOf(' ', 2);
                  String expLengthField = value.substring(2, indexOfSpace);
                  if (negate || negateExponent) expLengthField = negate(expLengthField);
                  int lengthOfExponent = Integer.parseInt(expLengthField);
                  // Read in the <exponent> (after the space) ...
                  int startIndex = indexOfSpace + 1;
                  endIndex = startIndex + lengthOfExponent;
                  String exponentField = value.substring(startIndex, endIndex);
                  exponent = Long.parseLong(negateExponent ? negate(exponentField) : exponentField);
                  if (negate) negateExponent = !negateExponent;
                  if (negateExponent) exponent = -exponent;
                  value = value.substring(endIndex);
          }
  
          // <significand>
          if (negate) {
              value = negate(value);
          }
          BigInteger significand = new BigInteger(value);
          int scale = (int)(value.length() - exponent - 1);
  
          // Now create the result ...
          return new BigDecimal(negate ? significand.negate() : significand, scale);
      }