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/utils/utils.py

    r14040 r14473  
    405405            return export_disabled_message
    406406        return None
     407
     408    def format_float(self, value, prec):
     409        # cut floating point value
     410        value = int(pow(10, prec)*value) / (1.0*pow(10, prec))
     411        return '{:{width}.{prec}f}'.format(value, width=0, prec=prec)
Note: See TracChangeset for help on using the changeset viewer.