Jump to content
  • 0

Rounding of Numbers


CaioVictor

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

Hi rAthena ^^'

 

First excuse my English.

 

I noticed that every division of numbers in NPC script returns a value rounded down.

Example:

2/3 = 0.6666
  •  correct rounding = 1
  •  returned = 0

1/2 = 0.5
  •  correct rounding = 1
  •  returned = 0

1/3 = 0.333
  •  correct rounding = 0
  •  returned = 0

 

So i wonder if anyone knows a way to divide numbers and return a correct rounding, or if someone could help me develop a custom command that makes the division correctly.

 

Any help will be greatly appreciated.

 

Att,

CaioVictor.

Edited by CaioVictor
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...