def normalize_timedelta(val):
 if (type(val) == str):
  val = parse_timedelta(val)
 if (not val):
  return ''
 hr = (val.seconds / 3600)
 mn = ((val.seconds % 3600) / 60)
 return ('%d.%02d' % (hr, ((mn * 100) / 60)))

def normalize_timedelta ( val ) : if ( type ( val ) == str ) : val = parse_timedelta ( val ) if ( not val ) : return '' hr = ( val . seconds / 3600 ) mn = ( ( val . seconds % 3600 ) / 60 ) return ( '%d.%02d' % ( hr , ( ( mn * 100 ) / 60 ) ) )
produces a normalized string value of the timedelta this module returns a normalized time span value consisting of the number of hours in fractional form .