Format Float in Script Report

I have this code in my script report. I want to format field amount float 2 decimal point because the default format is 3. How can I do that? :smile:

def execute(filters=None):
    data = []
    columns = [
        {"label": "Posting Date", 'width': 100, "fieldname": "posting_date", 'fieldtype': 'Date'},
        {"label": "Amount", "fieldname": "amount", 'fieldtype': 'Float', 'width': 100}
    ]

@ccfiel, add a property named precision

def execute(filters=None):
    data = []
    columns = [
        {"label": "Posting Date", 'width': 100, "fieldname": "posting_date", 'fieldtype': 'Date'},
        {"label": "Amount", "fieldname": "amount", 'fieldtype': 'Float', 'width': 100, 'precision': 2}
    ]
3 Likes

@max_morais_dmm thanks a lot!