# How to get a exact XYZ ?

Comments in 'Plugin Development' started by PlayCubePE, Aug 1, 2015.

1. Offline

### PlayCubePENew Member

Joined:
Mar 19, 2015
Posts:
29
Minecraft User:
Hello, i just need to know how to get a non decimal position !

I used :

getX
getY
getZ

And i got some crazy numbers like 124,00754325865 and so on..

But i just want to get 124

Without Decimal
2. Offline

### iiDeathStrokeiiActive Member

Joined:
Mar 30, 2015
Posts:
111
Minecraft User:
Getround() I think.
3. Offline

### Kvetinac97Active MemberPlugin Developer

Joined:
Nov 17, 2014
Posts:
276
Plugins:
1
Minecraft User:
PHP:
``` \$x = round(\$p->getX()); //If X is 124.0005 it'll return 124, if it's 124.58770000 it'll return 125//or:\$x = ceil(\$p->getX()); //If X is 124.0005 it'll return 125, if it's 124.58770000 it'll return 125//or:\$x = floor(\$p->getX()); //If X is 124.0005 it'll return 124, if it's 124.58770000 it'll return 124 ```
Last edited by a moderator: Aug 1, 2015
TheKofola12 and PEMapModder like this.
4. Offline

### iiDeathStrokeiiActive Member

Joined:
Mar 30, 2015
Posts:
111
Minecraft User:
Orr use you math skills and see that it is 124
5. Offline

### Kvetinac97Active MemberPlugin Developer

Joined:
Nov 17, 2014
Posts:
276
Plugins:
1
Minecraft User:
I think he/she uses it in some if(\$x == 124) functions, so he/she can't solve it by seeing it
TheKofola12 likes this.
6. Offline

### PlayCubePENew Member

Joined:
Mar 19, 2015
Posts:
29
Minecraft User:
Thanks you, solved
7. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
PHP:
``` // All functions below will return integer\$player->getFloorX();\$player->getFloorY();\$player->getFloorZ(); ```
Andrey Nazarchuk likes this.
8. Offline

### Kvetinac97Active MemberPlugin Developer

Joined:
Nov 17, 2014
Posts:
276
Plugins:
1
Minecraft User:
But floor(\$p->getX()); will work too!
TheKofola12 and PEMapModder like this.