jcbollinger wrote:
> On Wednesday, August 1, 2018 at 5:05:32 AM UTC-5, Helmut Schneider
> wrote:
> >
> > Hi,
> >
> > is there a way to format text in epp? Something like
> >
> > a 100
> > abc 20
> > defgds 30
> >
> > Thank you!
> >
> > <%- | Hash $postfixTransport
> > | -%>
> > # This file is managed by Puppet, don't edit it by hand.
> > # All changes will be overwritten!
> >
> > <% if ($postfixTransport) { -%>
> > <% $postfixTransport.each |$domain, $target| { -%>
> > <%= $domain %> <%= $target %>
> > <% } -%>
> > <% } -%>
> >
> >
> EPP has access to all operators, functions, and types available in
> the current Puppet environment, both built-in and module-provided.
> Among Puppet's built-in functions is sprintf
> <
https://puppet.com/docs/puppet/5.5/function.html#sprintf>, which is
> a wrapper for Ruby's Kernel::sprintf
> <
https://apidock.com/ruby/Kernel/sprintf>, which in turn is inspired
> by C's sprintf. It can perform the kind of formatting you're looking
> for, perhaps something like this:
>
> <% $postfixTransport.each |$domain, $target| { -%>
> <%= sprintf("%-10s %4d", $domain, $target) %>
> <% } -%>
Thank you!