User Tag List

Results 1 to 7 of 7

Thread: Limiting Edit Object characters

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Limiting Edit Object characters

    Is there an easy way to limit an Edit Objects characters after a decimal point.

    Here's the issue,..

    When calculating a figure,.the length of the characters are to long running the app on an Android device only. I would like to limit the number of characters to 6.
    Can this be done? I already have the expression to round the calculation, but this still doesn't work on Android devices. Running the app on a PC is fine.

    Example: On a PC it is returning,.. 111.175
    On an Android device it's returning,...111.17502054231717

    I would like the calculation to be same on Android as it is on the PC version. Being a max length of 6 characters total.

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Well I couldn't find a way to return the same numbers with math, so I came up with a workaround that just edits the return string and shortens it to however many places you want:

    set edit text to Mid$(Edittext$( "Edit Box" ), 0, (Find(Edittext$( "Edit Box" ), ".", 0 )+1) + 3 )

    It uses Find() to return everything in the string up to the decimal point, then the +3 is however many numbers you want displayed after that.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I'll give it a shot.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hmmm,.can't seem to use the expression you have. The Expression I'm using for the calculation is Str$(Round(1353.0 / Val(Edittext$( "E6" ) ) ) )
    Do I add yours to a new line or same line? Not sure where/how it should be placed?

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    You use my expression after the fact. You set the edit box to your expression, then just edit the edit box text itself immediately after with mine. Do it on the same line.

    Set edit box text to Str$(Round(1353.0 / Val(Edittext$( "E6" ) ) ) )
    Set edit box text to Mid$(Edittext$( "Edit Box" ), 0, (Find(Edittext$( "Edit Box" ), ".", 0 )+1) + 3 )

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Also it might be obvious but make sure you change my example's edit box name to whatever yours is

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Perfect. It worked. Thank you

Similar Threads

  1. Removing characters from Edit Box/String
    By Jaklar in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 7th May 2013, 03:05 PM
  2. Register Characters Typed in Edit Box
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 13th December 2012, 10:08 PM
  3. Count number of characters in a text edit?
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th June 2012, 01:33 PM
  4. Advanced Dir Object - Limiting to 8 directions
    By Kid_Roleplay in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 31st December 2009, 07:41 AM
  5. Edit Box disable invalid characters
    By lordzero in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 22nd May 2009, 11:01 PM

Posting Permissions

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