Code example for DecimalFormatSymbols

Methods: getMonetaryDecimalSeparatorsetCurrency

0
	 
	public CurrencyWatcher() 
	{ 
		Log.i(TAG + ".CurrencyWatcher()", "Detected locale: " + Locale.getDefault().getDisplayName());
		 
		DecimalFormatSymbols dfs = new DecimalFormatSymbols();
		mChanged = false;
		String new_currency = Database.getOptionString("override_locale");
		Currency cur = null;
		if (new_currency != null && !new_currency.equals(""))
		{ 
			cur = Currency.getInstance(new_currency);
		} 
		else 
		{ 
			cur = NumberFormat.getInstance().getCurrency();
		} 
		dfs.setCurrency(cur);
		mSeparator = dfs.getMonetaryDecimalSeparator();
		mFractionDigits = cur.getDefaultFractionDigits();
		mAccepted = new Character[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', mSeparator};
		 
		Log.i(TAG + ".CurrencyWatcher()", "Separator: " + mSeparator);
		Log.i(TAG + ".CurrencyWatcher()", "Model: " + Build.MODEL);
Contextual code suggestions in your IDE  Get Codota for Java