patrikos's Forum Posts

  • 5 posts
  • AllanR

    Ha, that's a great work around, works perfectly! Thanks for the idea.

  • Hi,

    Thanks for responding. Yes, I did see that tutorial, I was just wondering if there was a better way of forming the calculation as it seems the source number is off (obviously not by much). It just seemed a bit weird to have to do this for 10 + 0.2.

    If I get no other inspiration I will have to follow that string cleaning approach or re-think the whole idea.

    Thanks anyway.

  • Hi,

    I am incrementing an instance variable. When I come to display this value on the screen, Construct2 is showing a large number of decimal places that should not be there according to the calculation.

    I attach a capx doc. In this example, I am incrementing the value 10 by 0.2, and had expected to see:

    10

    10.2

    10.4

    etc

    Instead, the display is showing:

    10

    10.2

    10.399999999999998

    10.599999999999996

    etc

    Do I need to round to 2 decimal places each time? It feels I shouldn't need to do this kind of tidying up for such a simple calculation.

    http://studioxenon.com/code/rounding_error/rounding_error.capx

  • Ah, excellent. I was editing my original un-imported file and (obviously) not seeing any changes. I hadn't noticed the "Files" sub-folder.

    Thanks for that, appreciate it.

  • Try Construct 3

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

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

    I am populating an array via a JSON project file. It all works fine. However, if I want to change the data in the file I have to re-import it which automatically deletes the associated AJAX "request file" action. There must be a way to easily edit these files without having to re-insert the deleted action every time, any clues?

    Thanks.

  • 5 posts