hex to decimal(2dp)

void checkEPSCommand(byte byteRead[])
{
byte responseByte[7] = {0x00};
switch(byteRead[2])
{
case 01:
//Request Device ID

for (int i=0; i<3;i++)
{
responseByte = byteRead*;*
* }*
* responseByte[6] = DeviceID;*
* replyCommand(responseByte);*
* break;*
* case 02:*
* //Read Analog Voltage*
* // read the input on analog pin 0:*
* int sensorValue = analogRead(A0); //declared*
* // Convert the analog reading*
_ float voltage = sensorValue * (12.0 / 1023.0);
* {*
* for (int i=0; i<=12;i++)*
* {*
responseByte = byteRead*;*
* }
responseByte[5] = (byte)voltage >> 16;
responseByte[6] = (byte)voltage;
replyCommand(responseByte);
break;
}
}
}*

anybody that can help me? it is now showing a real number only when im trying to get the values. i need to make them to display in decimals with 2 decimal place. anybody kind enough to help? thanks alot_

You probably get better responses if you read the posting guidelines written by Nick Gammon as presented at the top of this Forum, especially the use of code tags when posting source code. Read them, follow what they say, and things will likely improve.

float voltage = sensorValue * (12.0 / 1023.0);
   {

Which Arduino operates at 12 volts?

responseByte[5] = (byte)voltage >> 16;
     responseByte[6] = (byte)voltage;

Utter nonsense. Casting a float to a byte is nonsense. Shifting a byte 16 places to the right is nonsense. A float will NOT fit in two bytes in the packet.