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

Version Path
dentaku-3.5.4 lib/dentaku/ast/functions/roundup.rb
dentaku-3.5.3 lib/dentaku/ast/functions/roundup.rb
dentaku-3.5.2 lib/dentaku/ast/functions/roundup.rb
dentaku_zevo-3.5.2 lib/dentaku/ast/functions/roundup.rb
dentaku-3.5.1 lib/dentaku/ast/functions/roundup.rb
dentaku-3.5.0 lib/dentaku/ast/functions/roundup.rb
dentaku-3.4.2 lib/dentaku/ast/functions/roundup.rb
dentaku-3.4.1 lib/dentaku/ast/functions/roundup.rb
dentaku-3.4.0 lib/dentaku/ast/functions/roundup.rb