class MarketDisplayBaseImpl implements MarketDisplay {

	@Override
	public String priceFractionText(PriceValue price, Fraction frac) {
		
		if (price == null) {
			price = ValueConst.NULL_PRICE;
		}
		
		if(frac == null || frac.isNull()) {
			frac = Fraction.NULL;
		}
		
		long value = frac.priceFraction(price.mantissa(), price.exponent());
		
		final char[] array = new char[frac.places()];
		
		for(int k = frac.places() - 1; k >= 0; k--) {
			final char alpha = (char) (value % 10 + '0');
			value /= 10;
			array[k] = alpha;
		}
		
		return new String(array);
	}

}