event.force creating too many decimal places on android

Hi all,

I am using event.force to create the users score on a successful hit in my app.

However, in android if a user hits the target a certain way, at a certain force the force appears with 30 decimal places (represented as 11 decimals and then ‘e+19’ appended on the end.

I am unable to use my score function correctly with this many decimals - has anyone else experienced this?

Any advice?

Thanks [import]uid: 125592 topic_id: 29496 reply_id: 329496[/import]

I’m looking in to this further and wonder if it occurs if two objects are hit at the same time, producing two event forces??

Is it possible to reference the specific event force? [import]uid: 125592 topic_id: 29496 reply_id: 118442[/import]

Im not really sure why thats happening… But you could always use something like math.round to get the number back to an integer. Alternatively if you still wanted a few decimal points after it you could use string.sub to limit it a specified amount of numbers. [import]uid: 69826 topic_id: 29496 reply_id: 118446[/import]

Hi, thanks for the reply, I’ve tried both math.round and math.floor, but to no avail.

The frustrating part is that it is not consistent and limited to Android, is it possible that my two collision events (one for an item and one for my ‘enemy’) are conflicting when triggered at identical times?

Would a delay, like the one mentioned here be worthwhile? http://jonbeebe.tumblr.com/post/2515495262/corona-collision-no-no

Thanks again [import]uid: 125592 topic_id: 29496 reply_id: 118448[/import]