@property
    def elements(self):

        # If babel is available, use its comprehensive locale skills
        if babel:
            value = self
            curr_sym = self.locale.currency_symbols.get(self.currency,
                                                            self.currency)
            decimal_sym = self.locale.number_symbols.get('decimal', ".")
            value = babel.numbers.format_decimal(value, "#,##0.00",
                                                        locale=self.locale)

        # If no babel, use Django's built-in locale data
        else:
            value = "%.02f" % self
            curr_sym = self.currency
            decimal_sym = get_format('DECIMAL_SEPARATOR', self.locale)
            group_sym = get_format('THOUSAND_SEPARATOR', self.locale)
            num_group = get_format('NUMBER_GROUPING', self.locale)
            value = numberformat.format(value, decimal_sym, None,
                                                    num_group, group_sym)

        major, minor = value.rsplit(decimal_sym, 1)
        return locals().copy()
Returns a dict of the various elements for localised display.
dataset/ETHPy150Open willhardy/Roll-Your-Own/rollyourown/commerce/utils/formatting.py/FormattedDecimal.elements