Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

An Awk Primer/A Digression: The sprintf Function

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

While "sprintf()" is a string function, it was not discussed with the other string functions, since its syntax is virtually identical to that of "printf()". In fact, "sprintf()" acts in exactly the same way as "printf()", except that "sprintf()" assigns its output to a variable, not standard output. For example: BEGIN { var = sprintf("[%8.3f]", 3.141592654); print var }—yields: [ 3.142]