i want to print a 'double' variable upto 8 decimal places without trailing zeroes.
for eg:
if a= 10.1234 then print 10.1234
if a= 10.00 then print 10
if a= 10.11111111111 then print 10.11111111 (max of 8 decimal places).
how to do it?
i searched for it and found this:
printf("%g",a);
this work fine but print upto 6 decimal places.