Re: [Puppet Users] Rounding in variable expressions

2011-11-16 Thread Tom Hall
> Alternatively the cheap and hacky approach: > $foo = inline_template("<%= (processorcount.to_i * 0.8).floor -%>") That looks direct and sexy to me. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us

Re: [Puppet Users] Rounding in variable expressions

2011-11-15 Thread Dan Carley
On 15 November 2011 16:57, Jacob Helwig wrote: > On 2011-11-15 07:24 , Tom Hall wrote: > > Hi, > > > > Can you round in variable assignment expressions? > > > > I would like to be able to set > > > > $my_var = floor(::processorcount * 0.8) > > > > Cheers, > > Tom > > > > That should work just fin

Re: [Puppet Users] Rounding in variable expressions

2011-11-15 Thread Jacob Helwig
On 2011-11-15 07:24 , Tom Hall wrote: > Hi, > > Can you round in variable assignment expressions? > > I would like to be able to set > > $my_var = floor(::processorcount * 0.8) > > Cheers, > Tom > That should work just fine as long as you define an rvalue function called 'floor'. There shoul

[Puppet Users] Rounding in variable expressions

2011-11-15 Thread Tom Hall
Hi, Can you round in variable assignment expressions? I would like to be able to set $my_var = floor(::processorcount * 0.8) Cheers, Tom -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@google