title: Printing float values using only syscalls in C
body: <p>I am trying to write a C program to print the filesizes in human readable format (i.e, in KB, MB, GB, etc). The input is the filesize in bytes. The catch is that this is to be done using only system calls and NO library calls.</p>
  
  <p>I have already written a function that converts a positive integer into a string and then prints it using write() system call. I am clueless as to how to print decimal values using write() as the filesize after conversion(in KB or MB or GB) could be decimals.(For Ex: 4.0K, 5.6G etc).</p>
  
  <p>Also, is it possible to limit precision to some fixed length (say 2 decimal places) ??</p>