// a NumberFormatsSupplier has to be created first "in the open countryside"...
Object oNumberFormatsSupplier = m_xMCF.createInstanceWithContext("com.sun.star.util.NumberFormatsSupplier", m_xContext);
XNumberFormatsSupplier xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, oNumberFormatsSupplier);
XNumberFormats xNumberFormats = xNumberFormatsSupplier.getNumberFormats();
// is the numberformat already defined?
int nFormatKey = xNumberFormats.queryKey(sFormatString, aLocale, true);
if (nFormatKey == -1){
// if not then add it to the NumberFormatsSupplier
nFormatKey = xNumberFormats.addNew(sFormatString, aLocale);
}