User Tag List

Results 1 to 8 of 8

Thread: Don't know how to use floating point values

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Fortaleny (Valencia - Spain)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Don't know how to use floating point values

    Hi everyone! I'm a little embarrased for making this question, but I don't know how can I use floating point values in my programs. I know it's possible, by adding .0 or something like that, but this doesn't work for me.

    Please, can anyone explain it to me?

    I'm trying to get a weight coefficient. I have 3 EditBoxes:

    Weight, Height and Coefficient.

    Coefficient = Weight/(Height*Height)

    When I click on a button, the Coefficient EditBox should show the result, but it always is an integer number.

    Thank you.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    Norway
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Coefficient = (Weight*1.0)/(Height*Height)

    ^^ I think it is like that
    Jean Villy Edberg

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Fortaleny (Valencia - Spain)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Thanks! I'll give it a try and I'll post the results.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Fortaleny (Valencia - Spain)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Well, I couldn't make it work, but... I tried an easier way. I simply wrote "Val(Get Text)", without adding 0.1, and it worked fine. Now I'm fighting to put it online, but Vitalize won't work with MMF2 programs :-(

    Thank you again, my friend.

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Don't know how to use floating point values

    Make sure you use (val(Edittext$( "Edit Box" ))+0.0) instead of Edit Value( "Edit Box" ).
    .:::.Joshtek.:::.

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Fortaleny (Valencia - Spain)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Hi. This is what I've used:

    [color:#3333FF][font:Courier New]Val(Edittext$( "Peso" ))/(Val(Edittext$( "Altura" ))*Val(Edittext$( "Altura" )))[/font][/color]

    Without the "+0.0"... Maybe I'm doing something wrong, but it works fine, now.

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Always perform a multiplication before a division for the most accurate results

  8. #8
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Fortaleny (Valencia - Spain)
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Don't know how to use floating point values

    Quote Originally Posted by raytrace
    Always perform a multiplication before a division for the most accurate results
    [grin] Thanks!

Similar Threads

  1. [BUG] floating point rotation
    By SolarB in forum iOS Export Module Version 2.0
    Replies: 5
    Last Post: 2nd December 2012, 01:40 AM
  2. Positions with Floating Point Values
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 28th April 2011, 12:07 AM
  3. Floating Point Arrays?
    By Dines in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 1st January 2008, 11:00 PM
  4. Suggestion: Floating point values in Properties
    By Dines in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 29th November 2006, 10:53 AM
  5. Floating Point Numbers
    By killacam in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 5th October 2006, 06:37 AM

Posting Permissions

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