title: Convert extended value to Time
body: <p>I want to convert a extended value to time.
  before the DecimalSeparator is hours
  after the decimalseparator are minutes digital</p>
  
  <pre><code>8,62944444444444  --&gt; 8:37
  1,41666666666667  --&gt; 1:25
  </code></pre>
  
  <p>I've made this funtion but I get for 1,41666666666667  --> 1:24 
  It must be 25 minutes</p>
  
  <pre><code>function MyConvertion(AValue: Extended): TDateTime;
  var
      Hour, Min, Sec, MSec: Word;
  begin
    Hour:= Trunc(AValue);
    Min:= Trunc(Frac(AValue)*60);
    result:= EncodeTime(Hour, Min, 0, 0);
  end;
  </code></pre>
  
  <p>When I use exact 1,41666666666667 I'm get 1:25
  But the value I must convert comes out from a soap enterface as double (oPostCalculationDay.DirectAssignedWorkTime).</p>
  
  <p>The value I get in debug mode = 1,41666666666667</p>
  
  <pre><code>MyConvertion(1,41666666666667) --&gt; 1:25
  MyConvertion(oPostCalculationDay.DirectAssignedWorkTime) --&gt; 1:24
  MyConvertion(RoundTo(oPostCalculationDay.DirectAssignedWorkTime, -15)) --&gt; 1:25
  MyConvertion(RoundTo(oPostCalculationDay.DirectAssignedWorkTime, -16)) --&gt; 1:24
  MyConvertion(strtofloat(floattostr(oPostCalculationDay.DirectAssignedWorkTime)))--&gt; 1:25
  </code></pre>
  
  <p>I'm thinking is something like <a href="http://rvelthuis.de/articles/articles-floats.html" rel="nofollow">Floating points</a></p>
  
  <p>But what is the best methode I must use? Roundto -14 because 1,41666666666667 is 14 numbers after the separator of something else?</p>