Given an example:
We need to calculate a size of a subsections for an audio album playback progress bar. Each track in the album has the length represented as a TimeSpan value. The total length of an album is also a TimeSpan.
I need to calculate how much weight length-wise each track has in comparison to an entire album, so I can draw it respectively on a progress bar.
I know that it is not possible to devide two TimeSpan variables as is, so I am attempting to divide .Ticks.
long coeff = curTrackLength.Ticks / _totalLength.Ticks;
Such division always results in 0. I need a more precise value. How can I achieve a more precise calculation?
An environment is a Silverlight for Windows Phone Mango.
You need to cast at least one side to
doubleordecimalto avoid integer division.