You may wish to swap the bytes of a numeric value, rather than rely on the debugger’s knowledge of representation. The "%" unary operator reverses all the bytes of its integer operand.
For example:
(idb) printx %(short)258
0x201
(idb) printx %(int)258
0x2010000
(idb) printx %(long long)258
0x201000000000000