User Tag List

Results 1 to 4 of 4

Thread: How do you code a working Kill/Death ratio?

  1. #1
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you code a working Kill/Death ratio?

    Hello guys.

    My question is, how do you program a Kill/Death ratio in MMF2? Sure, you can do Kills/Deaths but I don't want loads of decimal points, sure you can add a .0 on normal numbers, but I cannot seem to find a way with expressions like this.

    value( "kill" )/value( "death" )

    And when I do get it, how do I make it only have 2 decimals in MMF2? for example.

    142/60 = 2.36

    But I only want 2 decimals as shown there, otherwise it would be something like 2.3666666666666666666667 and I don't want that.

    Thanks in advance

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you code a working Kill/Death ratio?

    What about rounding?

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you code a working Kill/Death ratio?

    To cut to any number of decimal places, do this:

    round(number * (10 pow places)) / (10 pow places)

    ...or is it pow(10, places)? I don't remember whether MMF does pow as a function or an operator... thanks Jamie.
    EDIT: Replace "places" with the number of decimal places you want to round to, of course.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    James's Avatar
    Join Date
    Jun 2006
    Location
    Newcastle, UK
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you code a working Kill/Death ratio?

    Operator.

Similar Threads

  1. Calculations in MMF2 code - It's not working, help
    By moonyjacob in forum File Archive
    Replies: 23
    Last Post: 15th February 2010, 01:09 AM
  2. Need help getting my jump code working
    By mobichan in forum File Archive
    Replies: 2
    Last Post: 19th January 2009, 04:22 PM
  3. Kill enemy from top ?
    By basit in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th September 2008, 12:59 AM
  4. Working animation skipped over in new life code
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 21st February 2008, 10:03 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
  •