def format_currency_legend(currency_value, currency_symbol='€'):
    """ Given an numeric value of currency, return the value with the correct legend to display it in short format
        (euros, kilo euros, etc...) rounded at two digits
        ex : 8765432 € => 8.76 m€

    :params: currency_value, numeric currency values
    :type: float

    :params: currency_symbol, symbol of the currency (default = '€')
    :type: string

    :returns: string
    """

    value = currency_value
    legend_letter = ''
    if isinstance(currency_value, str):
        return currency_value
    else:
        if abs(currency_value) >= 1.0e9:
            value = currency_value / 1.0e9
            legend_letter = 'B'
        elif 1.0e9 > abs(currency_value) >= 1.0e6:
            value = currency_value / 1.0e6
            legend_letter = 'M'
        elif 1.0e6 > abs(currency_value) >= 1.0e3:
            value = currency_value / 1.0e3
            legend_letter = 'k'

        return f'{round(value, 2)} {legend_letter}{currency_symbol}'