How do I find the solution to rounding issue.

0 favourites
  • 3 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • Formula (var.a/var.b)*var.c

    All are instance variables are from different sprites.

    All show to have no decimals in debugger.

    var.a =5

    var.b=375

    var.c=100

    (5/375)*100=1.333333333

    *** In debugger the number returned is 1 *** Should be 1.333333333 ***

    I do not have a floor or a round used on any of these numbers and the value returned makes zero sense to me.

    Any thoughts?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey Js,

    I just tried it and it works for me. Try and recreate it in a fresh project and see if it comes up the same again. You must have something in your events rounding it?

  • Call this one closed. I'm using sprites in multiple families and loading data from arrays and hard code. I tried to recreate the issue to no avail, so it's in my code (seems the most obvious reason anyway).

    I changed family variable from one family to another and it works fine...don't know why, atm it works fine so don't really care. Moving on lol.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)