public static final String flongToString(long l, int dp)
			throws FixedPointLongException {
		try {
			boolean negative = l < 0;
			if (negative)
				l = -l;
			long intpart = l >> OFFSET;
			long fracpart = ((l & ((1L << OFFSET) - 1)));

			StringBuffer flongToStringBuf = new StringBuffer();

			if (fracpart != 0L) {
				int power10 = 0;
				while (bitsUsed(fracpart) < LENGTH - 3) {
					fracpart *= 10L;
					power10++;
				}
				fracpart = fracpart >> OFFSET - 1;
				fracpart = (fracpart >> 1) + (fracpart & 1); // rounding
				if (dp > -1) {
					while (power10 > dp + 1) {

						fracpart = fracpart / 10;
						power10--;
					}
					if (power10 > dp) {
						fracpart = (fracpart / 10)
								+ ((fracpart % 10 > 5) ? 1 : 0);
						power10--;
					}
				}
				flongToStringBuf.append(fracpart);
				while (flongToStringBuf.length() < power10)
					flongToStringBuf.insert(0, '0');
				if (flongToStringBuf.length() > power10) {
					// This is overkill
					// char[] cs = new char[afterPointBuf.length()-power10];
					// afterPointBuf.getChars(0,afterPointBuf.length()-power10,cs,0);
					// long carry=Long.parseLong(new String(cs));
					// System.out.println("afterPointBuf.length " +
					// afterPointBuf.length() + " >power10 " + power10 + " : " +
					// afterPointBuf + " : intpart " + intpart + ", carry " +
					// carry);
					// intpart += carry;
					// afterPointBuf.delete(0,afterPointBuf.length()-power10);

					intpart += 1;
					flongToStringBuf.deleteCharAt(0);
				}
				if (dp == -1) {
					int newlength = flongToStringBuf.length();
					while (newlength > 0
							&& flongToStringBuf.charAt(newlength - 1) == '0')
						newlength--;
					flongToStringBuf.setLength(newlength);
				} else {
					while (flongToStringBuf.length() < dp) {
						flongToStringBuf.append('0');
					}
				}
				if (flongToStringBuf.length() > 0) {
					flongToStringBuf.insert(0, '.');
				}
			}
			flongToStringBuf.insert(0, intpart);
			if (negative)
				flongToStringBuf.insert(0, '-');

			// System.out.println("String rep of flong " + l + " (int " +
			// intValue(l) + ") is " + flongToStringBuf);
			return flongToStringBuf.toString();
		} catch (Exception e) {
			throw new FixedPointLongException("flongToString Exception: " + e);
		}

	}