User Tag List

Results 1 to 4 of 4

Thread: insert commas in number string

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jul 2006
    Location
    Athens, GA
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    insert commas in number string

    Hi,

    How can I insert commas into a number of any length to show place value.

    For example:
    10000 converts to 10,000
    100000 converts to 100,000
    10000000 converts to 10,000,000
    etc.

    Thanks in advance

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: insert commas in number string

    I don't know if this is the best way of doing it, or if there are any extensions that can do it, but at least this works fine

    Have a text box named 'Big value' and a String object named 'Formatted string'.

    * Player presses Enter
    - Formatted string: Set text to ""
    - Start loop "scan value"

    * On loop "scan value"
    - Formatted string: Set alterable string to Mid$(Edittext$( "Big value" ), Len(Edittext$( "Big value" ))-LoopIndex("scan value"), 1)+string$( "Formatted string" )

    * On loop "scan value"
    + Loopindex("scan value") mod 3 = 0
    + Loopindex("scan value") > 0
    + Loopindex("scan value") < Len(Edittext$( "Big value" ))

    - Formatted string: Set alterable string to "," + string$( "Formatted string" )

    Use Compare two general values for the last 3 conditions



  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jul 2006
    Location
    Athens, GA
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: insert commas in number string

    Thanks- this helps.

    I was hoping there was an easier way since I have to chart 4 different payments at a time.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jul 2006
    Location
    Athens, GA
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: insert commas in number string

    I found that I can add commas with Formatted Object and easily strip the commas with Tokens Object.

Similar Threads

  1. Check for number in a string
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd December 2012, 08:44 PM
  2. Simply way to insert commas into a number string?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 31st August 2012, 09:38 PM
  3. How to insert a value in a string?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 21st May 2012, 12:22 PM
  4. Number of string letters to a value
    By cajujoe in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th August 2011, 10:23 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
  •