ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Converting minutes to hh: nn
Posted by Ricardo Frias on Mar-11-2011 06:36
Guys, good night!

I'm having difficulty because I have a value in minutes and must display it in the format "hh: nn ".
Did so:

viewer.ImageMap = c.getHTMLImageMap("clickable", "", _
        "title='{xLabel}: {={value}|hh:nn:ss}'")

The value is 4816 minutes, and instead of returning 80:16, 01:20:16 is returning, as if he is considering 4816 seconds instead of minutes.

If anyone can help me I appreciate it!

Att,

  Re: Converting minutes to hh: nn
Posted by Peter Kwan on Mar-11-2011 12:47
Hi Ricardo,

Please use:

viewer.ImageMap = c.getHTMLImageMap("clickable", "", _
        "title='{xLabel}: {value|nn:ss:00}'")

Hope this can help.

Regards
Peter Kwan

  Re: Converting minutes to hh: nn
Posted by Ricardo on Mar-11-2011 19:41
Did the way you showed me, but keeps reappearing 20:16 instead of 80:16.

The error only occurs in cases where it has more than 60 hours, probably because he is considering minutes.

Thanks!

  Re: Converting minutes to hh: nn
Posted by Ricardo on Mar-11-2011 22:58
I made some changes:

data0(i - 1) = extra60 * 60 (to convert from minutes to seconds)

And now it's returning "08:16", which would be 3 days (72 hours) and those remaining 08:16, totaling the "80:16" I would like to appear.

:-(

Thanks

  Re: Converting minutes to hh: nn
Posted by Peter Kwan on Mar-12-2011 00:26
Hi Ricardo,

In date/time formatting yyyy-mm-dd hh:nn:ss, the hh means hour of day, which is from 0 to 23 (or 1 to 12 if you use AM/PM mode).

The hour in your case is called elapsed hour. The elasped hour is simply the number divided by 60, but with the minute part removed first. So it is:

{=({value}-{value}%60)/60}:{value|ss}

In the above, the first part is the elapsed hour (from 0 to infinity), while the second part is the minute of hour (from 0 - 59). There is no need to multiply the number by 60 first.

Hope this can help.

Regards
Peter Kwan

  Re: Converting minutes to hh: nn
Posted by Ricardo on Mar-12-2011 01:42
Perfect Peter, that was it!

Thank you very much!