Код:
return s_szReturn;
}
else if(iTag == tagof(Float:))
{
if(iDecimals == -1)
iDecimals = 8;
format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
}
else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
{
format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
return s_szReturn;
}
else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
{
format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
return s_szReturn;
}
else if(iTag == tagof(bit_byte:))
{
format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
return s_szReturn;
}
else
{
format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
if(iDecimals > 0)
{
strcat(s_szReturn, ".");