I need to convert a number that represents a big pile of milliseconds from a start time into HH:MM:SS.hh (hh being hundreds of seconds).
Is there a more elegant way of doing it than a bunch of division with If..Then statements?
GetAsTime ( Div ( milliseconds ; 10 ) / 100 )
Thank you, very much!
Why the div function?
can't you just divide by 1000?
To get 2 digits in SS.hh (Round() or Ceiling() or field formatting can be used for cases)
But for a time value, I don't think that you need to do any rounding or truncating...
OP want 2 digits as .hh
GetAsTime(1234567/1000) results 3digits as 0:20:34.567
There was no state for choosing .56 or .57 (round up) so I used Div
You can round instead of truncate as you did the div function and you can also just display the value as rounded via data formatting the time value in the inspector. (Round can round a value to values other than just an integer.)
"hundredths of seconds", that is.
Is there any way to force this to display the two hundredths digits, even if they're zeros? It will look better on the report. Fixed number of decimals doesn't work. I made it work by extracting the third character from the right and performing concatenations based on that value, but you know, there might be a more elegant way to do that.
You'd need text (calculation result) field instead of time.
GetAsTime ( Div ( ms ; 1000 ) ) & SerialIncrement ( ".00" ; Mod ( ms / 10 ; 100 ) )
Thank you, again!
Retrieving data ...