🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

formatting strings

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Submitted by pdickens on Mon, 02/27/2012 - 04:06 

Is there any way to format strings in VisSim? Specifically, I would like to take the output from the timeOfDay block (i.e. integers representing the year/month/day/hour...) and produce a formatted string from the integers to represent the time (e.g. 10:34:21 am). The timeStamp block can output a string, but I need to process and/or store the values before display, so timeStamp won't work.

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Submitted by a_a on Mon, 02/27/2012 - 22:28.

    Try to convert the values into strings and then use the summingJunction to make the representation you need. The attached diagram will give you the hint.

    Unable to find an attachment - read this blog

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Submitted by pdickens on Mon, 03/12/2012 - 08:35.

    Thanks a_a, I hadn't thought of using the summing block to concatenate strings - but it makes sense. Just had to add some logic to pad with zeros when the h, m or s variable is less than 10.