Hi everybody again!!

I have a problem. I want to write formatted numbers in to a text file. In my output array... i have numbers like "0.02151812165" and i just want 2 decimals. Anyone know how to do this?

I have a problem. I want to write formatted numbers in to a text file. In my output array... i have numbers like "0.02151812165" and i just want 2 decimals. Anyone know how to do this?

I thought this would be easy to find for you, but I don't see any built in way to do this. One can set the global settings for sig figs, but this won't change the data written to file.

You might just right your own user function to do this.

If A is your number and B is the number of decimal places you can run your number through this function. round(A*10^B)/10^B

Basically just multiply your number by 10^B to move the decimal place, then do a normal int rounding, then move the decimal place back. Attached is a screen shot of a simple user function called dround (decimal round) that could do this. There is a warning message in case the user put a decimal number less than 1

Does any one else know of a built in way to do this?

Best regards,