cancel
Showing results for 
Search instead for 
Did you mean: 

formatDuration() has a maximum?

marcpaige
Astronaut

One of my team discovered that formatDuration() has a maximum input value of 2147483 resulting in an output of "24d 20:31:23". Is this a bug?

5 REPLIES 5

marcpaige
Astronaut

We are still testing. It seems there is an error on the testing side with our data. 

So, it turns out that the issue was with using int() vs. long() in the internal conversion of a millisecond calculation. 

The documentation is not clear for formatDuration(). It states that it takes an int value. It should also state that it can take a long value as using that conversion function results in the proper result.

JoeM
Community Manager
Community Manager

@marcpaige we can make that update - just need to clarify with you here first. Are you saying that you found it to take a long() and it did generate results albeit them incorrect? 

Using formatDuration(long((calculated double value)) returns a correct result.

When using the int() conversion function it returns the max value of INT format.