Bonjour,
J'ai un problème avec une fonction qui convertit une heure décimale en format h:m:s.
T = 62E800 en hexa et 6481920 en décimal (14h4min0sec)
quand je convertit à l'aide du code ci-dessous, j'ai la variable sec qui est égal à 60. J'ai fais un test (if) pour checker cette variable et le programme n'entre pas dans mon if quand sec est égal à 60.
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 res := (StrToInt('$'+T) / 460800); h := Int(res); min1 := (res-h)*60; min := Int(min1); sec := (((res-h)*60)-min)*60; if sec >= 60 then begin min := min +1; sec := sec-60; end; if min >= 60 then begin h := h +1; min := min - 60; end; heure := FormatFloat('00',h)+':'+FormatFloat('00',min)+':'+FormatFloat('00'+DecimalSeparator+'00',sec);
Partager