Module: Trxl::RoundFunction1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



6130
6131
6132
6133
6134
6135
6136
# File 'lib/trxl/trxl_grammar.rb', line 6130

def eval(env = Environment.new)
  if ((v = value.eval(env)) && !v.is_a?(TrueClass))
    format("%0.#{digits.eval(env)}f", v).to_f
  else
    nil
  end
end