Compare "similar" numbers in Python
Honestly, I think you nailed it already with the floor and ceil calls, but for somplicity you might want to do floor((ipodtime/1000)+1) == localrepostime to check equality since the ipod time seems to round down no matter what.
In order to sync my iPod and my local music repository, I created a unique key for each track using its metadata. The unique track consists of the track's following metadata fields:
artist, album, track number, duration. The iPod saves the track's duration in milliseconds, but my local repository saves it in seconds. For example: 437590 milliseconds on iPod is 438 seconds in my Local repository.
When I divide the ipod's track duration by 1000 I get 437. I tried using round(), but round (b.tracklen/1000) prints 437.
I can hack this by checking math.ceil(), math.floor() for the iPod duration if there is no match but it's a lousy solution.
What is the best approach to this issue?