Ignore:
Timestamp:
27 Jan 2017, 15:53:33 (8 years ago)
Author:
Henrik Bettermann
Message:

Define and use format_float utility method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r14438 r14473  
    5656        )
    5757    table = []
     58    format_float = getUtility(IKofaUtils).format_float
    5859    for stud in result:
    5960        if not stud['studycourse'].has_key(str(level)):
     
    7172        end_level = getattr(stud['studycourse'].certificate, 'end_level', None)
    7273        if end_level and level >= end_level:
    73             cgpa = '%.2f' % (int(100*level_obj.cumulative_params[0])/100.0)
     74            cgpa = format_float(level_obj.cumulative_params[0], 2)
     75            #cgpa = '%.2f' % (int(100*level_obj.cumulative_params[0])/100.0)
    7476        else:
    75             cgpa = '%.3f' % (int(1000*level_obj.cumulative_params[0])/1000.0)
     77            cgpa = format_float(level_obj.cumulative_params[0], 3)
     78            #cgpa = '%.3f' % (int(1000*level_obj.cumulative_params[0])/1000.0)
    7679        if remark == 'FRNS':  # Faculty Requirements Not Satisfied (AAUE)
    7780            cgpa = ''
     
    8285                level_obj.gpa_params[1],
    8386                passed_params[2],
    84                 '%.3f' % (int(1000*level_obj.gpa)/1000.0),
     87                format_float(level_obj.gpa, 3),
     88                #'%.3f' % (int(1000*level_obj.gpa)/1000.0),
    8589                failed_courses,
    8690                not_taken_courses,
Note: See TracChangeset for help on using the changeset viewer.