android - Converting decimal number into ascii in java -
i want break decimal number , convert ascii format can view in text view.
i getting battery percentage device decimal.i cant display directly passing decimal number, need pass ascii text view.
for eg: getting data in byte array; consider arr[7] has value 98 means battery 98% want display value 98 need pass 0x39 , 0x38 respectively how can break 98 0x39 , 0x38 respectively. tried doing bitwise ending 0x0f , 0xf0 , added 0x30 gave me wrong value.
use string.valueof(byte)
string representation of byte.
if must have ascii representation, can use tochararray()
method in string
.
Comments
Post a Comment