NAME
Catmandu::Fix::format - replace the value with a formatted (sprintf-like) version
SYNOPSIS
# e.g. number: 41format(number,"%-10.10d") # number => "0000000041"# e.g. numbers:# - 41# - 15format(number,"%-10.10d %-5.5d") # numbers => "0000000041 00015"# e.g. hash:# name: Albertformat(name,"%-10s: %s") # hash: "name : Albert"# e.g. array:# - 1format(array,"%d %d %d") # Fails! The array contains only one value, but you request 3 values# Test first if the array contains 3 valuesif exists(array.2)format(array,"%d %d %d")end
DESCRIPTION
Create a string formatted by the usual printf conventions of the C library function sprintf. See <http://perldoc.perl.org/functions/sprintf.html> for a complete description.
SEE ALSO
Catmandu::Fix , sprintf