@Override
	public String getEquateName(long value, int size, boolean isSigned, Program program) {
		Scalar scalar = new Scalar(size * 8, value);
		if (isSigned) {
			long v = scalar.getSignedValue();
			String valueStr = Long.toString(v, 16).toUpperCase();
			if (v < 0) {
				// use of substring removes '-' prefix for negative value
				return "-0x" + valueStr.substring(1);
			}
			return "0x" + valueStr;
		}
		String valueStr = Long.toHexString(scalar.getUnsignedValue()).toUpperCase();
		// Instructions rely on equate which uses 0x prefix (consistent with default scalar formatting)
		return "0x" + valueStr;
	}
Convert a selected constant in the decompiler to a hexadecimal representation.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/ConvertHexAction.java