User Tag List

Results 1 to 3 of 3

Thread: help with counter and decimals

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    mikec's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with counter and decimals

    Hi,
    I am trying to use a counter to display amounts of money. What i am trying to do is set a counter to £565,000

    When i set the counter to 565.000 it changes it to just 565.0

    I also need to subtract amounts of money from the counter but have the same problem, how can i subtract 200.000 from 565.000 and get the counter to display 365.000.

    Thanks for your help


  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,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: help with counter and decimals

    Here is one way to do it:

    First make sure you operate with numbers multiplied with 1000 of the ones you need. For instance instead of setting a counter to 123.7 set it to 123700.

    We will use a String object to display the correct value.

    [events]
    * Always
    - Set String to Left$(Str$(value( "Counter" )), Len(Str$(value( "Counter" )))-3)+"."+Right$(Str$(value( "Counter" )), 3)

    [/events]

    This is using the substring functions. You find them by clicking on Retrieve Data From Object, and then under the Special icon.

    What it does is splitting the value into two parts, one with the the first (length of number - 3) digits, and one with the last 3. Then it writes "." between them.

    I hope this helps.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    mikec's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: help with counter and decimals

    Thanks.
    I think it's working ok now, only thing i had to add to your expresion was an event to remove the '.' when the value went below 1000

    thanks

Similar Threads

  1. BUG (Beta 257.17) Counter unable to display decimals
    By mobichan in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 2nd May 2013, 09:33 AM
  2. [bug] COUNTER (number of decimals)
    By StingRay in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 9th April 2013, 12:27 PM
  3. decimals usable in "Counter" extension?
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th August 2010, 07:18 PM
  4. Decimals In x and Y pos?
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th December 2007, 12:36 PM
  5. Decimals
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 31
    Last Post: 20th July 2006, 01:31 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
  •