<commit_before>{% extends "_layout.html" %}
{% set active_page = 'commodities' %}

{% block content %}
    <h1>Commodities</h1>

    {% set commodity_pairs = api.commodity_pairs() %}

    {% with hide_interval_filter=True  %}
        {% include "charts/_chart_skeleton.html" %}
    {% endwith %}

    <script>
    {% for commodity in commodity_pairs %}
        window.chartData.push({
            label: "{{ commodity.0 }} / {{ commodity.1 }}",
            type: "line",
            options: {
                dateFormat: "MMM 'YY"
            },
            data: {
                series: [{
                    name: '{{ commodity.0 }} /  {{ commodity.1 }}',
                    data: [
                        {% set prices = api.prices(commodity.0, commodity.1) %}
                        {% for price in prices %}
                            {
                                x: new Date({{ price.0.year }}, {{ price.0.month-1 }}, {{ price.0.day }}),
                                y: {{ price.1 }},
                                meta: "1 {{ commodity.0 }} = {{ price.1 }} {{ commodity.1 }}<br><em>{{ price.0 }}</em>"
                            },
                        {% endfor %}
                    ]
                }]
            }
        });
    {% endfor %}
    </script>

    <div class="commodities">
        {% for commodity in commodity_pairs %}
            <div class="commodity-container commodity-{{ commodity.0 }}-{{ commodity.1 }}" style="float: left; margin-right: 20px; ">
                <h3>{{ commodity.0 }} / {{ commodity.1 }}</h3>
                <table class="commodity sortable">
                    <thead>
                        <th data-sort="string" data-sort-default="desc" class="sorting-asc">Date</th>
                        <th data-sort="float">Price</th>
                    </thead>
                    <tbody>
                        {% set prices = api.prices(commodity.0, commodity.1) %}
                        {% for price in prices %}
                            <tr>
                                <td>{{ price.0 }}</td>
                                <td class="num">{{ price.1 }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        {% endfor %}
    </div>
{% endblock %}<commit_msg>use format_currency for commodities report<commit_after>{% extends "_layout.html" %}
{% set active_page = 'commodities' %}

{% block content %}
    <h1>Commodities</h1>

    {% set commodity_pairs = api.commodity_pairs() %}

    {% with hide_interval_filter=True  %}
        {% include "charts/_chart_skeleton.html" %}
    {% endwith %}

    <script>
    {% for commodity in commodity_pairs %}
        window.chartData.push({
            label: "{{ commodity.0 }} / {{ commodity.1 }}",
            type: "line",
            options: {
                dateFormat: "MMM 'YY"
            },
            data: {
                series: [{
                    name: '{{ commodity.0 }} /  {{ commodity.1 }}',
                    data: [
                        {% set prices = api.prices(commodity.0, commodity.1) %}
                        {% for price in prices %}
                            {
                                x: new Date({{ price.0.year }}, {{ price.0.month-1 }}, {{ price.0.day }}),
                                y: {{ price.1 }},
                                meta: "1 {{ commodity.0 }} = {{ price.1 }} {{ commodity.1 }}<br><em>{{ price.0 }}</em>"
                            },
                        {% endfor %}
                    ]
                }]
            }
        });
    {% endfor %}
    </script>

    <div class="commodities">
        {% for commodity in commodity_pairs %}
            <div class="commodity-container commodity-{{ commodity.0 }}-{{ commodity.1 }}" style="float: left; margin-right: 20px; ">
                <h3>{{ commodity.0 }} / {{ commodity.1 }}</h3>
                <table class="commodity sortable">
                    <thead>
                        <th data-sort="string" data-sort-default="desc" class="sorting-asc">Date</th>
                        <th data-sort="float">Price</th>
                    </thead>
                    <tbody>
                        {% set prices = api.prices(commodity.0, commodity.1) %}
                        {% for price in prices %}
                            <tr>
                                <td>{{ price.0 }}</td>
                                <td class="num">{{ price.1|format_currency(commodity.1) }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        {% endfor %}
    </div>
{% endblock %}
{'fraction_non_alphanumeric': 0.1546868432114334, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 1.0799825174825175, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7035088', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1235, 'n_words': 244}