# Decode: How NOT hex2integer using zTrack by Zane

**URL:** <https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194>\
**Category:** Application Development\
**Created:** [May 14, 2018, 9:23pm UTC](https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194 "2018-05-14T21:23:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluesensing1](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluesensing1/32/42705_2.png) [@bluesensing1](https://www.thethingsnetwork.org/forum/u/bluesensing1)\
**Post date:** [May 14, 2018, 9:23pm UTC](https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194/1 "2018-05-14T21:23:35Z")

</div>

original payload: 4xxxxA 0xxxxx 022A 10 029266  
the last byte, =\>11 is 66. this is exactly the battery capacity and should not be converted in integer  
but i dont know how?

var battery = bytes[11];

does not work

capacity then is 102 but it is 66 %

how can i solve this? i have no idea about java…

can i convert this back to HEX with a simple command?

regards

doc: [http://goo.gl/Uf6PQD](http://goo.gl/Uf6PQD)

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [May 14, 2018, 9:50pm UTC](https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194/2 "2018-05-14T21:50:03Z")

</div>

A post was merged into an existing topic: [zTrack Q + A topic](https://www.thethingsnetwork.org/forum/t/ztrack-q-a-topic/14196)

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [May 14, 2018, 9:50pm UTC](https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194/3 "2018-05-14T21:50:03Z")

</div>



---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [May 14, 2018, 9:51pm UTC](https://www.thethingsnetwork.org/forum/t/decode-how-not-hex2integer-using-ztrack-by-zane/14194/4 "2018-05-14T21:51:59Z")

</div>


