def format_nominal(nominal_dict):
    """
    format dictionary like:
    {'units': '98', 'nano': 475000000} -> to float 98,4750
    {'currency': 'rub', 'units': '267', 'nano': 400000000} -> to float 267,4000
    {'currency': 'rub', 'units': '1000'} -> to float 1000,0000
    {'currency': 'usd', 'nano': 195000000} -> to float 0,1950
    """
    if 'units' in nominal_dict and 'nano' in nominal_dict:
        nominal = int(nominal_dict['units']) + float(nominal_dict['nano']/1000000000)
    elif 'nano' in nominal_dict and 'units' not in nominal_dict:
        nominal = float(nominal_dict['nano']/1000000000)
    else:
        nominal = int(nominal_dict['units'])
    return float('{:.4f}'.format(nominal))