playMaker

Author Topic: Convert Seconds To String - total minutes  (Read 4671 times)

ken168

  • Playmaker Newbie
  • *
  • Posts: 11
Convert Seconds To String - total minutes
« on: November 03, 2024, 10:12:59 PM »
Hello everyone:

I found a problem when using Convert Seconds To String:

Seconds = 3700 = 01:01:40:00
({1:D2}:{2:D2}:{3:D2}:{10})

But what I really want to display is the format
61:40:00
(total minutes)

So I use {7:F0}:{3:D2}:{10}
But it shows 62:40:00

Seconds = 3700 = 61.66 =62
It will be rounded to 62

But this is not the result I want

Please tell me how I should set it up to display the results I want.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Convert Seconds To String - total minutes
« Reply #1 on: November 11, 2024, 04:53:39 AM »
Hi,

yep, this is unfortunatly an issue indeed.

First option: use the ecosystem action "GetTimeSpanInfo", feed it seconds, and you get the total minutes as a float which you can then round to in, which gives you 61



Second option, I make a copy of the playmaker action on the ecosystem and add new entries that will give you the roundeddown version of these values.

Let me know if the second option suits you better, and I upload that action.

Bye,

Jean

ken168

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Convert Seconds To String - total minutes
« Reply #2 on: December 23, 2024, 06:58:45 AM »
Hello:
Thank you for your reply.
I want to use this function to record the time passed through the game.

Later, my method was to handle the minutes and seconds separately.
Then merge them into strings.

Thank you very much.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Convert Seconds To String - total minutes
« Reply #3 on: December 26, 2024, 06:00:35 AM »
Hi,

 use the getTimeSpanInfo action, this will do. Have you tried it?

Bye,

Jean

ken168

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Convert Seconds To String - total minutes
« Reply #4 on: December 26, 2024, 09:33:52 AM »
Hello,

Yes, I used Get Time Span Info
It's very convenient and works fine

thank you very much