0

I'm trying to convert a value in Cross-tab of Crystal report into a MM:SS format. I used the following steps: Right-click summary > Format Field > Display String > x+2

WhilePrintingRecords;
NumberVar curr := CurrentFieldValue;
NumberVar mins := Truncate(curr / 60);
NumberVar secs := Remainder(curr, 60);
ToText(mins, 0, "") & ":" & ToText(secs, 0, "")

The results are ok when the secs is not 0. Example: `4:30'

But, I am having problems when secs is 0, the result is (for 4 minutes): 4:0

I would like to have the output as 4:00, with the seconds display as always a 2 digit number.

Thank you for all your help

bcmacariola
  • 106
  • 2
  • 15

2 Answers2

0

You my ElapsedTime function in conditional-formatting expression.

craig
  • 25,664
  • 27
  • 119
  • 205
0

I used this instead, and it worked :)

NumberVar curr := CurrentFieldValue;
NumberVar mins := Truncate(curr / 60);
NumberVar secs := Remainder(curr, 60);
ToText(mins, 0, "") & ":" & ToText(secs, '00')
bcmacariola
  • 106
  • 2
  • 15