leading zero for an integer

I am successfully uploading a 4 data streams to pachube, but today I just realized that using the below code a value of 8.06 is being uploaded as 8.6 ?? I believe I read somewhere that this is called padding. Can someone help me with a suggestion how to add padding to this code ? Many thanks.

int temp_Current1 = (temp_Current - (int)temp_Current)*100;
      int pH_val1 = (pH_val - (int)pH_val)*100;
      sprintf(pachube_data,"%0d.%d,%0d.%d,%d,%d,%d,%d",(int)temp_Current,abs(temp_Current1),(int)pH_val,abs(pH_val1),orp_val,orpSD_val, successes + 1, failures);

cheers, Marian

If the value is less than 0.1, print a zero.

%02d will format an integer as 2 digits wide with leading 0s as necessary. The 0 is significant, it's not the same as %2d :slight_smile:

%02d works perfectly. Many thanks !