User Tag List

Results 1 to 6 of 6

Thread: Force 2 Digits

  1. #1
    sns2015
    Guest

    Force 2 Digits

    I'm trying to create a log for an application I'm making and I can't figure out how to get the seconds or hours readout from the Date and Time object to add a zero to the beginning of normally single-digit numbers. Is there a way to do this? Thanks for any help.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    Alonso's Avatar
    Join Date
    Jul 2006
    Posts
    681
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force 2 Digits

    I don't think there's a default option for this. The best thing you can do is, if there's no simpler way, use a condition that determines how long an hour/minute string is and set the text to zero ("0") plus the one digit.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force 2 Digits

    I just did this with a counter:

    Left$("0000", 4-Len(Str$(value( "Counter" ))))+Str$(value( "Counter" ))

    It sets the string to "0000" and then tacks on the value of the counter, removing the appropriate amount of 0's to fit it in.

    For a single digit with the date and time, insert this:

    Set string to:
    Left$("00", 2-Len(Str$(hours of( "Date & Time" ))))+Str$(hours of( "Date & Time" ))

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Force 2 Digits

    Right$( "0" + Str$( value("Counter") ), 2) ?

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force 2 Digits

    I knew there was a simpler way to do it! Use MuddyMole's method.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Location
    USA
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force 2 Digits

    Aw muddymole beat me to it. Yeah, that's the best way to do it.

Similar Threads

  1. > 16 significant digits?
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th July 2012, 04:43 AM
  2. Limiting digits
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th February 2009, 06:20 AM
  3. Arrays and Double Digits
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 5th October 2008, 02:02 PM
  4. [Bug?] Counter and fixed number of digits = 0
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd December 2007, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •