Cancel
Showing results for 
Search instead for 
Did you mean: 

Remove miliseconds from time display

Creator
Creator

Hi,

 

I'm trying to make the way I display time neater within Plant Sim.

 

I don't need to be able to display anything less than seconds so I'm trying to get rid of the .0000 on each of my time displays.

 

Is there a simple way to do this?

 

I believe I could write a method using omit but it won't remove the values I want at all points of the simulation as the position of the start of .0000 changes. Also I'd prefer to know if there's an alternative way as I have a lot of displays and removing the .0000 from all of them would be very time consuming.

 

Best,

 

Lucy

4 REPLIES

Re: Remove miliseconds from time display

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you can also enter commands into the path field of the display, if you need e.g. only a second value from the procTime of a SingleProc object, you can enter into the path of the display:

 

round(time_to_num(SingleProc.procTime))

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Remove miliseconds from time display

Creator
Creator

Hi Steffen,

 

Sorry, that's not the problem I'm having. I understand you can use funcitons within the path field of the display I just can't find one that will let me omit the part of the time I don't need.

 

To explain myself a little better:

 

I want to display the full time for example  21:01:30:10.0000

 

But I don't need the .0000 at the end I'd prefer it to be displayed as 21:01:30:10

 

Best wishes,

 

Lucy

 

 

Re: Remove miliseconds from time display

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
okay, looks only a little bit more complex:

(splitString(to_str(singleProc.procTime),"."))[1]
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Remove miliseconds from time display

Creator
Creator

Fantastic!

 

Thank you! It looks much better now.

 

Best wishes,

 

Lucy