int diny6h = Integer.parseInt(Integer.valueOf(diny6).toString(), 10);
int diny7h = Integer.parseInt(Integer.valueOf(diny7).toString(), 10);
diny6h=diny6h-32;
diny7h=diny7h-32;
System.out.println(diny6h + " + " + diny7h);
}
Incoming: diny6=30
diny7=20
printed: diny6h=16
diny7h=00
What i want: diny6h=10
diny7h=00
What am i doing wrong here?
EDIT: well.. the numbers are send as hexadezimals and received as decimals, because the other numbers in the block (not diny6 and 7, but diny1 to diny5) are needed as hexadezimals. but diny6 and 7 are needed as decimals but im not able to get them the way i want i want to send a 35(hex) it comes in as 53(dec) and should be pirnted out as 10(dec). Same issue: want to send a 20(hex) it comes as a 32(dec) and should printed as 0
In short:
I send the 35, received as 53, but i need the 35 to reduce it by 20 and get the 15... how do i do that?
EDIT:
I am sorry for my yesterdays cofusing. WHat i need is to convert my received value to a BCD-number... nothing with hex ^^ should i delete this question now?