How do I find the solution to rounding issue.

Get help using Construct 2

Post » Thu Dec 22, 2016 11:53 pm

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?
B
11
S
2
Posts: 33
Reputation: 651

Post » Fri Dec 23, 2016 3:35 pm

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?
ImageImage
B
123
S
23
G
7
Posts: 1,071
Reputation: 13,091

Post » Fri Dec 23, 2016 3:45 pm

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.
B
11
S
2
Posts: 33
Reputation: 651


Return to How do I....?

Who is online

Users browsing this forum: richcoz81 and 48 guests