Developer

MAFCurrencyFormatter

MAFCurrencyFormatter formats currency values according to country ISO code.

It is the combination of a numeric (amount) and a textual (currency code) element. Formatted numerical values are delimited by colons or periods, depending on the ISO code, and the currency symbol (if any); or its alphabetical code is prefixed to the digits.

Formatting rules are defined in a currencyformats.xml file. Supported currencies are defined in this file in this format:
…..
	<ISO_CURRENCY>
		<ENTITY>UNITED STATES</ENTITY>
		<CURRENCY>{US_Dollar}</CURRENCY>
		<ALPHABETIC_CODE>USD</ALPHABETIC_CODE>
		<NUMERIC_CODE>840</NUMERIC_CODE>
		<MINOR_UNIT>2</MINOR_UNIT>
	</ISO_CURRENCY>
……
To use the MAFCurrencyFormatter with predefined currencies, implement this code:
MAFCurrencyFormatter currencyFormatter;
currencyFormatter = MAFCurrencyFormatter.getInstance(context);
currencyFormatter.initWithSAPXML();
To use custom currency formatting with a custom XML file, call this method:
currencyFormatter.initWithCustomXML(InputStream iStream);
For the method details of the MAFCurrencyFormatter, see its API documentation.