User Tag List

Results 1 to 10 of 10

Thread: Single Digit to Double Digit

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Single Digit to Double Digit

    Can I use the expression editor to make a single digit 0-9 number double digit, so 00-09? I'm dealing with time here, so hours/minutes/seconds. It would take a number of conditions to check if all three values are 0-9 at once, so if there's an easy solution for this I'd like to know.

    Thanks.

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Found an old thread. Mods may as well delete this unless someone else might find this useful.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=192423

  3. #3
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Situation not averted. I'm trying to use this, keep in mind CurrentSecond is a global variable.

    Str$( Left$("0",2-Len(Str$(value(CurrentSecond))))+Str$(value(Curren tSecond)) )

    The number two is causing the problem. I'm not very good with expressions so I'm probably doing something very stupid. Anyway, I'd appreciate any help.

  4. #4
    No Products Registered

    Join Date
    Aug 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Assuming you are using two counters, could you not simply say, "If counter 1 = 99" then add to the condition "If counter 2 = 99", do etc.

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    What you're doing here is taking as many characters as needed from the string "0" to fill up the remainder of the string (one 0 if the original value is 1 digit long, or none if it's two - therefore, (2 - the length of the original string) zeroes), then putting the original value (in string form) after it.

    If the value is 1 digit long (e.g. "7"):

    Left$("0", 2-1) = "0" (the first 1 characters of the string "0") + "7"

    = "07"

    If the value is 2 digits long (e.g. "94"):

    Left$("0", 2-2) = "" (No characters of the string "0") + "94"

    = "94"

    So the expression is - set string to:

    Left$("0", 2-Len(Str$(value(CurrentSecond)))) + Str$(value(CurrentSecond))

    You appear to have rather more brackets and stages than necessary in your original expression, but it's difficult to tell without syntax highlighting.

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Yeah, I forgot to remove the Str$ at the beginning which I added hoping it would help. Otherwise it's the same as on the link I provided above. I have nothing to do with the expression that's written, other than adding in the global values.

    http://img714.imageshack.us/img714/2791/expreditor.png

    Ausomeman, I'm not using counters. I'm retrieving the system date and time and setting global values to these numbers.

  7. #7
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Oh, I never noticed you were using global values - you don't need value(), in that case. That's for retrieving the value of a counter object.

    Left$("0", 2-Len(Str$(CurrentSecond)))+Str$(CurrentSecond)

  8. #8
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    Ah, right! It works, thanks.

  9. #9
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,132
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    There is a simple option on the counters somewhere that allows them to be displayed with multiple digits. so one is displayed as 01. no need for events.

  10. #10
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Mantis's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Single Digit to Double Digit

    That is true. But when converted to string, it becomes single digit.

Similar Threads

  1. Removing last digit
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th November 2012, 10:58 PM
  2. Expression Help - Set single digit in global value
    By CBSection31 in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 23rd March 2011, 08:22 PM
  3. digit problem
    By Herbert in forum File Archive
    Replies: 1
    Last Post: 13th February 2010, 10:04 AM
  4. Get a digit from a counter
    By Raylax in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 13th December 2008, 11:51 PM
  5. Build 247 - Counter Digit Example
    By drnebula in forum File Archive
    Replies: 1
    Last Post: 23rd November 2007, 06:37 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
  •