public String toString(int radix, boolean zeroPadded, boolean showSign, String pre,
			String post) {
		if (!signed) {
			showSign = false;
		}

		long val;
		if (showSign) {
			val = getSignedValue();
			int shiftCnt = 64 - bitLength;
			val <<= shiftCnt;
			val >>= shiftCnt;
		}
		else {
			val = getUnsignedValue();
		}

		String b;
		StringBuffer buf = new StringBuffer(32);
		if (bitLength == 64 && !signed) {
			b = getBigInteger().toString(radix);
		}
		else if (radix == 10) {
			b = Long.toString(val);
		}
		else {
			if (showSign) {
				if (val < 0) {
					val = -val;
					buf.append('-');
				}
			}
			switch (radix) {
				case 2:
					b = Long.toBinaryString(val);
					break;
				case 8:
					b = Long.toOctalString(val);
					break;
				case 16:
					b = Long.toHexString(val);
					break;
				default:
					throw new IllegalArgumentException("Invalid radix");
			}
		}
		buf.append(pre);
		if (zeroPadded) {
			int numDigits = getDigits(radix);
			for (int i = 0; i < numDigits - b.length(); ++i) {
				buf.append("0");
			}
		}
		buf.append(b);
		buf.append(post);
		return new String(buf);
	}
<p>Get a String representing this Scalar using the
format defined by radix.</p>
@param radix an integer base to use in representing the number
 (only 2, 8, 10, 16 are valid).  If 10 is specified, all
 remaining parameters are ignored.
@param zeroPadded a boolean which if true will have the
 number left padded with 0 to the width necessary to hold
 the maximum value.
@param showSign if true the '-' sign will be prepended for negative values, else
value will be treated as an unsigned value and output without a sign.
@param pre a String to append after the sign (if signed) but before
 the digits.
@param post a String to append after the digits.

@return a String representation of this scalar.

@throws IllegalArgumentException If radix is not valid.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/scalar/Scalar.java