Sha256: 23a4a38a2de2e3606aa1ed82abb4cde1374f1e94e2b7d015d70dc5c234b72d9f
Contents?: true
Size: 324 Bytes
Versions: 9
Compression:
Stored size: 324 Bytes
Contents
require_relative '../function' Dentaku::AST::Function.register(:roundup, :numeric, lambda { |numeric, precision = 0| precision = Dentaku::AST::Function.numeric(precision || 0).to_i tens = 10.0**precision result = (Dentaku::AST::Function.numeric(numeric) * tens).ceil / tens precision <= 0 ? result.to_i : result })
Version data entries
9 entries across 9 versions & 2 rubygems