How can I convert double to byte array in Java? I looked at many other posts, but couldn\'t figure out the right way.
Input = 65.43
byte[] size = 6
precisi
This is what I got based on your inputs and it serves my purpose. Thanks for helping out!
static int formatDoubleToAscii(double d, int bytesToUse, int minPrecision, byte in[], int startPos) {
int d1 = (int)(d * Math.pow(10, minPrecision));
String t = String.format("%0"+bytesToUse+"d", d1).toString();
System.out.println("d1 = "+ d1 + " t="+ t + " t.length=" + t.length());
for(int i=0 ; i