Method: ArelExtensions::MathFunctions#round

Defined in:
lib/arel_extensions/math_functions.rb

#round(precision = nil) ⇒ Object

function is used to round a numeric field to the number of decimals specified



88
89
90
91
92
93
94
# File 'lib/arel_extensions/math_functions.rb', line 88

def round precision = nil
    if precision
        ArelExtensions::Nodes::Round.new [self, precision]
    else
        ArelExtensions::Nodes::Round.new [self]
    end
end