/home/soi/CM/man/man1/fnum(1)
Table of Contents

fnum \- print number in one or more formats.SH SYNOPSIS
.B fnum
\fInumber\f \fIformat1\f [format2...]
.SH DESCRIPTION
.NXR ""

The

.I number
can be an integer or a floating point. Number with exponential symbol `e' is accepted (eg. 1.32e3; 123e-2) and will be treated as a floating point.

The formatting string,

.I format1
follows the conventions of the format argument in ANSI C's \fIprintf\f command. The number can be printed in more than one format and adjacent outputs are separated by a space.
.EX
.EE
.SH OPTIONS
.SH EXAMPLES
.NXR(e) ""

The following command lines produce the corresponding outputs:

.EX

\fIcommand\f
\fIoutput\f
fnum 1.23 %.3f
1.230
fnum 1.23 %6.1f
1.2
fnum -123 %d %.7d
-123 -0000123
fnum 123 "set%04d.data"
set0123.data
fnum 123e-5 %012f Hello
00000.001230 Hello
fnum 123e-10 %e
1.230000e-08
fnum 1234e999 %e
Infinity

.EE

Note that any number that contains `.' (decimal point) or `e'

(exponential sign) will be treated as a floating point and the only valid conversions are %f, %e (or %E), %g (or %G)

.SH FILES
none

.SH SEE ALSO
printf
.SH DIAGNOSTICS

.SH BUGS

Attempts to print a floating point in integer format

(eg.fnum 123.4 %d) will result in garbage output. Similarly, trying to print integer in floating point format does not work. .rs
.SH HISTORY
1993-08-04
.br
1994-02-08
.br

SOI Version 0.8

.#$Id: fnum.1,v 1.1 1994/02/17 00:10:10 CM Exp $ .#$Source: /home/soi/CM/man/man1/RCS/fnum.1,v $
.#$Author: CM $


Table of Contents