public static String call(PageContext pc, Object object, String mask) throws PageException {
	if (mask == null) return call(pc, object);
	if (mask.equalsIgnoreCase("roman")) {
	    return intToRoman(pc, (int) toNumber(pc, object, 0));
	}
	else if (mask.equalsIgnoreCase("hex")) {
	    return Integer.toHexString((int) toNumber(pc, object, 0));
	}
	else if (mask.equalsIgnoreCase(",")) {
	    return call(pc, object);
	}

	try {
	    Mask _mask = lucee.runtime.util.NumberFormat.convertMask(mask);
	    return new lucee.runtime.util.NumberFormat().format(Locale.US, toNumber(pc, object, _mask.right), _mask);
	}
	catch (InvalidMaskException e) {
	    throw new FunctionException(pc, "numberFormat", 2, "mask", e.getMessage());
	}
    }
public static String call ( PageContext pc , Object object , String mask ) throws PageException { if ( mask == null ) return call ( pc , object ) ; if ( mask . equalsIgnoreCase ( "roman" ) ) { return intToRoman ( pc , ( int ) toNumber ( pc , object , 0 ) ) ; } else if ( mask . equalsIgnoreCase ( "hex" ) ) { return Integer . toHexString ( ( int ) toNumber ( pc , object , 0 ) ) ; } else if ( mask . equalsIgnoreCase ( "," ) ) { return call ( pc , object ) ; } try { Mask _mask = lucee . runtime . util . NumberFormat . convertMask ( mask ) ; return new lucee . runtime . util . NumberFormat ( ) . format ( Locale . US , toNumber ( pc , object , _mask . right ) , _mask ) ; } catch ( InvalidMaskException e ) { throw new FunctionException ( pc , "numberFormat" , 2 , "mask" , e . getMessage ( ) ) ; } }
@param pc
@param object
@param mask
@return formated number
@throws ExpressionException