Changeset f89b2f1 in OpenWorkouts-current


Ignore:
Timestamp:
Jul 18, 2019, 1:11:40 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
c82fe79
Parents:
e57b2df
Message:

(#83) Fixed a bug when loading gpx files that lead to very long values of elevation
to be displayed everywhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/models/workout.py

    re57b2df rf89b2f1  
    280280                self.duration = timedelta(seconds=track.get_duration())
    281281                # length_3d returns meters
    282                 self.distance = Decimal(track.length_3d()) / Decimal(1000.00)
     282                self.distance = round(
     283                    Decimal(track.length_3d()) / Decimal(1000.00), 2)
    283284                ud = track.get_uphill_downhill()
    284                 self.uphill = Decimal(ud.uphill)
    285                 self.downhill = Decimal(ud.downhill)
     285                self.uphill = round(Decimal(ud.uphill), 0)
     286                self.downhill = round(Decimal(ud.downhill), 0)
    286287                # If the user did not provide us with a title, and the gpx has
    287288                # one, use that
Note: See TracChangeset for help on using the changeset viewer.