Code example for Currency

Methods: getCurrencyCode

0
		return currency;
	} 
 
	public static MonetaryAmount convert(MonetaryAmount anyCurrency,
			Currency currency) {
		if (anyCurrency.getCurrency().equals(currency)) {
			return anyCurrency;
		} 
		// JPY→USDのみサポート 1/80に。 
		final BigDecimal rate = BigDecimal.valueOf(80);
		if (anyCurrency.getCurrency().equals(Currency.getInstance("JPY"))
				&& currency.getCurrencyCode().equals("USD")) {
			return new MonetaryAmount(anyCurrency.getValue().divide(rate, 0,
					RoundingMode.DOWN), currency);
		} 
		return null; 
	} 
}