# Problem in sending negative values in the payload

**URL:** <https://www.thethingsnetwork.org/forum/t/problem-in-sending-negative-values-in-the-payload/35604>\
**Category:** LMIC\
**Created:** [March 24, 2020, 3:06am UTC](https://www.thethingsnetwork.org/forum/t/problem-in-sending-negative-values-in-the-payload/35604 "2020-03-24T03:06:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [March 24, 2020, 9:49am UTC](https://www.thethingsnetwork.org/forum/t/problem-in-sending-negative-values-in-the-payload/35604/6 "2020-03-24T09:49:23Z")

</div>

Also, the following still does not guarantee that the value will be decoded correctly. In fact, negatives values will erroneously decode into very large positive values if the decoder does not [support negative values](https://www.thethingsnetwork.org/forum/t/decrypting-messages-for-dummies/4894/4).

> [@bialy](#):
>
> More complex solution is present in your example:
> 
> ```cpp
> int16_t payloadTemp = …;
> byte tempLow = lowByte(payloadTemp);
> byte tempHigh = highByte(payloadTemp);
> // place the bytes into the payload
> payload[0] = tempLow;
> payload[1] = tempHigh;
> 
> ```

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/problem-in-sending-negative-values-in-the-payload/35604)._
