Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adds Cool.printf, refs #2277
  • Loading branch information
JJ committed Sep 27, 2018
1 parent e527812 commit 1d906f1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions doc/Type/Cool.pod6
Expand Up @@ -1480,13 +1480,28 @@ the case it's being used as a C<sub>
say 1.unpolar(⅓*pi);
# OUTPUT: «0.5000000000000001+0.8660254037844386i␤»
=head2 routine printf
=begin comment
Defined as:
method printf (*@args)
multi sub printf(Cool:D $format, *@args)
As a method, takes the object as a format using
L<the same language as C<Str.sprintf>|/type/Str#routine_sprintf>; as a sub, its
first argument will be
the format string, and the rest of the arguments will be substituted in the
format following the format conventions.
"%s is %s".printf("þor", "mighty");# OUTPUT: «þor is mighty»
printf( "%s is %s", "þor", "mighty"); # OUTPUT: «þor is mighty»
=begin comment
TODO:
sprintf, printf
sprintf
=end comment
Expand Down

0 comments on commit 1d906f1

Please sign in to comment.