Jump to content
Sign in to follow this  
f2k sel

Is this number an error?

Recommended Posts

Can any one help with this please.

When using an addeventhandler " handledamage" ect when I hit a certain part of an object it returns numbers like this 4.81904e-005, the rest of the time when shooting other parts of the object they're normal numbers.

I'd like to be able to filter out these numbers so I can take action when it's hit.

Any ideas?

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Without more details, I am guessing that you are targetting a section that is quite resistant to the weapon hitting it in that section, so you are getting a tiny fraction of a percentage of damage. What's that, maybe 0.000004819 damage? So in the handler you can just ignore damage < 0.1 or whatever suits you.

Share this post


Link to post
Share on other sites

4.81904e-005 is a perfectly fine number. It's just written in scientific notation:

The e-005 part means "take the decimal point and move it 5 positions to the left". If the number was positive (e.g. e005) you'd move it to the right instead.

Hmm, but there are not digits on the left to... Don't worry, just use zeros.

So, 4.81904e-005 == 0.0000481904

HTH

Share this post


Link to post
Share on other sites

Thanks guys, I've multiplied it by 50 and now and get some useful numbers. As always though you solve one problem and then another pops up.

Anyway Thanks again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×