Hi,
I am trying to create a ".dat" file in which I want to save the numbers in double precision with desired number of digits after decimal.
for example:
suppose I have the number 2.34567890, and I want to save it up to 2.345 i.e. to control the size of my variable type.
Use sprintf. You can specify the precision there, but be careful the precision of double numbers on other factors as well, but if you are intending to use till 14 or 16 digits after decimal, you can go ahead with sprintf.