rounding currency value based on its max decimal digits

def rounding(price, currency):
	""" rounding currency value based on its max decimal digits """
	currency = validate_currency(currency)
	price = validate_price(price)
	if decimals(currency) == 0:
		return round(int(price), decimals(currency))
	return round(price, decimals(currency))