Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!metro!piers From: fredb@suphys.physics.su.OZ.AU (R. J. Bassett) Newsgroups: comp.sources.d Subject: Re: Formatting numbers in SC 6.8 Message-ID: <1990Oct3.072547.12565@metro.ucc.su.OZ.AU> Date: 3 Oct 90 07:25:47 GMT References: <6854@lifia.imag.fr> Reply-To: fredb@suphys.physics.su.OZ.AU (R. J. Bassett) Organization: School of Physics, Uni of Sydney, Australia. Lines: 13 To customise the format of numbers with sc: 1. You can change the field-width and precision of entire columns (only) using the inbuilt format-changer, the 'f' command. This still leaves you in fixed-point notation which may not be what you want. 2. Print the particular cell as a STRING, and use the @fmt() function to convert a numeric expression into the displayed string. (To get this to work, type back over the leading '"' that sc gives you when you issue the '<' or '>' command.) 3. I wanted sc to revert to exponential notation whenever: - a value printed as "0" but was non-zero (ie abs(x)>1e-37) - a value overflowed the column width. I patched the source code to do this, can send the patch if you like.