AnsweredAssumed Answered

AF Attribute - format hours from double to hh:mm:ss

Question asked by Mirmanero on Dec 29, 2017
Latest reply on Dec 29, 2017 by rdavin

Hi all,


into AF I have a "double" attribute representing the number of hours during a day where some condition is fullfilled (using Analysis with TimeGE function). Now I'd like to show this number into PIVision Display with "hh:mm:ss" format.


I can do that using some support attributes:

1-  with formula DR calculate three integer attributes using "floor" to get the number of hours, minutes and seconds (es for minutes: "A=|Double;[floor((A-floor(A))*60)]")

2 - with string builder DR other three attributes concatenate "0" and the integers found at step 1 (es for seconds: 0'|Double|Seconds';)

3- with string builder concatenate all attributes found at step 2 using right formula: right('|Double|Hours|Concatenate',2);:;right('|Double|Minutes|Concatenate',2);:;right('|Double|Seconds|Concatenate',2)


is there a more "elegant" solution to avoid all these support attributes? (I have multiple time attributes to format)


PS: I tryed also to sum Double attribute to a "Today" attribute and use Format function inside String Builder DR but such solution fails when double is 24 since returns 00:00:00, moreover I'm not confident of behavior during DST switch days.


thank you,