User Tag List

Results 1 to 7 of 7

Thread: Decimal problem! (different result on android version)

  1. #1
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Aug 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Decimal problem! (different result on android version)

    Hello guys,

    I"m really struggle at this moment,

    The problem is, on Pc version in my Game I get different results for the Counters.


    PC Version(for e.g)= 6.04 Exp

    Android Version = 6.0400000 Exp (or more digits)

    how can I fix this Problem?

    Thank You!!!

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    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)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    2,074
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logum5 View Post
    Hello guys,

    I"m really struggle at this moment,
    The problem is, on Pc version in my Game I get different results for the Counters.
    PC Version(for e.g)= 6.04 Exp
    Android Version = 6.0400000 Exp (or more digits)
    how can I fix this Problem?
    Thank You!!!
    There's a little-known option FloatToString$(), which you can find under the System object Conversion expressions.
    Code:
    FloatToString$(>Value<, >Number of digits<, >Number of digits after decimal point or -1<)
    Put the number into the Value parameter. FloatToString will be in the Fusion help file if you need more detail.

    If you don't want to use that, you could also use
    Code:
    Left$(Str$(), numchars)
    ...but it's a bit more fiddly.

    On a side note, this forum is more for getting extension developers, not for Fusion issues. Next time ask in the Fusion 2.5 forum.
    (If you do need help with developing your own extension, clarify which coding language you want and more context for the decimal places)

  3. #3
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Aug 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Phi View Post
    There's a little-known option FloatToString$(), which you can find under the System object Conversion expressions.
    Code:
    FloatToString$(>Value<, >Number of digits<, >Number of digits after decimal point or -1<)
    Put the number into the Value parameter. FloatToString will be in the Fusion help file if you need more detail.

    If you don't want to use that, you could also use
    Code:
    Left$(Str$(), numchars)
    ...but it's a bit more fiddly.

    On a side note, this forum is more for getting extension developers, not for Fusion issues. Next time ask in the Fusion 2.5 forum.
    (If you do need help with developing your own extension, clarify which coding language you want and more context for the decimal places)

    Hi thank you for replying,

    I"m really a noob , I searched for 1 hour where I can find and edit the FloatToString$ Expression,

    can u tell me where I can find this option in Fusion 2.5?? thanks!!

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    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)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    2,074
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logum5 View Post
    Hi thank you for replying,

    I"m really a noob , I searched for 1 hour where I can find and edit the FloatToString$ Expression,

    can u tell me where I can find this option in Fusion 2.5?? thanks!!
    Heyo,
    You should be able to type it into any expression window.



    It's an expression, not a condition or action. The first expression is seen under Step 11 of the basic tutorial included with Fusion, i.e. the ChocoBreak tutorial.
    The differences between actions/conditions/expressions are discussed in the tutorial, which I highly recommend you follow.
    You can access the tutorial under Fusion menu, just go on menu and select Help > Tutorial.


    If you need more help, try using the Clickteam Discord.
    Images attachées Images attachées

  5. #5
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Aug 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Phi View Post
    Heyo,
    You should be able to type it into any expression window.



    It's an expression, not a condition or action. The first expression is seen under Step 11 of the basic tutorial included with Fusion, i.e. the ChocoBreak tutorial.
    The differences between actions/conditions/expressions are discussed in the tutorial, which I highly recommend you follow.
    You can access the tutorial under Fusion menu, just go on menu and select Help > Tutorial.


    If you need more help, try using the Clickteam Discord.
    Thank you for the help, now I know what u mean with the Expression editor!

    but I really tried to get it working , I dont know what I"m doing wrong here, this is what I tryed

    New event --> Always --> Set Counter

    thann Float to string , but I get Syntax error !!!

    I"m really going to get crazy . . .

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    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)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    2,074
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    If you're using Counter, then look in Counter object properties to set the number of decimal places (also note significant figures, the number of digits including before and after the decimal point).



    When you set the counter, use Set Value and pass the number directly, don't worry about FloatToString$(). FloatToString$() is more for outputting the number inside text-based expressions, not inside counters.




    Finally, if your number is not storing correctly in the counter, as in being rounded down, then add 0.0 to the final part of the expression.
    So instead of setting counter to say 1/3, set it to 1/(3 + 0.0).



    The reason why this happens is Fusion tries to not use decimal places if it doesn't think it needs it, and it works out whether it needs it by whether it sees a decimal point in the final part of the expression.
    Calculations without decimal places are called integer math, and processors can do that faster than ones with decimal places, called floating-point math. Hence Fusion's preference to use integer math if it can.
    Some objects won't let you use a decimal number in their properties, but allow you to use it by setting it by action. Counter is one of them; Initial Value won't store decimal places, but you can use Start of Frame > Counter: Set Value to work around it.
    Images attachées Images attachées

  7. #7
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Aug 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Phi View Post
    If you're using Counter, then look in Counter object properties to set the number of decimal places (also note significant figures, the number of digits including before and after the decimal point).



    When you set the counter, use Set Value and pass the number directly, don't worry about FloatToString$(). FloatToString$() is more for outputting the number inside text-based expressions, not inside counters.




    Finally, if your number is not storing correctly in the counter, as in being rounded down, then add 0.0 to the final part of the expression.
    So instead of setting counter to say 1/3, set it to 1/(3 + 0.0).



    The reason why this happens is Fusion tries to not use decimal places if it doesn't think it needs it, and it works out whether it needs it by whether it sees a decimal point in the final part of the expression.
    Calculations without decimal places are called integer math, and processors can do that faster than ones with decimal places, called floating-point math. Hence Fusion's preference to use integer math if it can.
    Some objects won't let you use a decimal number in their properties, but allow you to use it by setting it by action. Counter is one of them; Initial Value won't store decimal places, but you can use Start of Frame > Counter: Set Value to work around it.
    Thank you !! it works now perfectly!!!!

    thank you for your time dude!

    U dont know how Thankful I am!

Similar Threads

  1. Replies: 1
    Last Post: 4th April 2019, 08:34 PM
  2. Build API, Minimum Android Version, Target Android Version?
    By KLiK-iT in forum Android Export Module 2.5
    Replies: 4
    Last Post: 9th July 2014, 12:50 PM
  3. Replies: 7
    Last Post: 2nd December 2013, 01:22 PM
  4. problem with digit result
    By arthurh in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th September 2013, 02:26 PM
  5. I have a problem with decimal numbers
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 9th February 2009, 11:35 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
  •