English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
positional specifiers in format strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-24 (11:36)
From: Hendrik Tews <H.Tews@c...>
Subject: positional specifiers in format strings
Hi,

the positional specifiers in format strings don't work as
described. Both "%5$f" and "%.*3$f" are valid format strings
according to the docs, however:

	    Objective Caml version 3.10.0

    # Printf.printf "%5$f";;
    Bad conversion %$, at char number 0 in format string ``%5$f''
    # Printf.printf "%.*3$f";;
    Bad conversion %3, at char number 0 in format string ``%.*3$f''

[BTW, the manual says "For instance, %.*3$f prints a float with ..."
 -- I don't see any float in the output produced
 ;-)]

Could somebody explain how to use the positional specifiers? 

Bye,

Hendrik