2 strprintf - formatted print to a string
5 strprintf(fmt, x_1, x_2, ...)
14 This function returns the string formed from the characters that
15 would be printed to standard output by printf(fmt, x_1, x_2, ...).
18 ; strprintf("h=%d, i=%d", 2, 3);
21 ; c = config("epsilon", 1e-6); c = config("display", 6);
22 ; c = config("tilde", 1); c = config("outround", 0);
23 ; c = config("fullzero", 0);
24 ; fmt = "%f,%10f,%-10f,%10.4f,%.4f,%.f.\n";
26 ; strprintf(fmt,a,a,a,a,a,a);
27 "1.732051, 1.732051,1.732051 , ~1.7320,~1.7320,~1.
31 The number of arguments of strprintf() is not to exceed 1024.
37 strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
38 strscan, strscanf, substr,
40 printf, fprintf, print
42 ## Copyright (C) 1999-2006 Landon Curt Noll
44 ## Calc is open software; you can redistribute it and/or modify it under
45 ## the terms of the version 2.1 of the GNU Lesser General Public License
46 ## as published by the Free Software Foundation.
48 ## Calc is distributed in the hope that it will be useful, but WITHOUT
49 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
50 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
51 ## Public License for more details.
53 ## A copy of version 2.1 of the GNU Lesser General Public License is
54 ## distributed with calc under the filename COPYING-LGPL. You should have
55 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
56 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
58 ## @(#) $Revision: 30.1 $
59 ## @(#) $Id: strprintf,v 30.1 2007/03/16 11:10:42 chongo Exp $
60 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strprintf,v $
62 ## Under source code control: 1996/03/12 22:50:41
63 ## File existed as early as: 1996
65 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
66 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/