lib/dentaku/ast/functions/roundup.rb in dentaku-2.0.11 vs lib/dentaku/ast/functions/roundup.rb in dentaku-3.0.0
- old
+ new
@@ -1,7 +1,8 @@
require_relative '../function'
-Dentaku::AST::Function.register(:roundup, :numeric, ->(numeric, precision=0) {
+Dentaku::AST::Function.register(:roundup, :numeric, lambda { |numeric, precision = 0|
+ precision = precision.to_i
tens = 10.0**precision
- result = (numeric * tens).ceil / tens
+ result = (Dentaku::AST::Function.numeric(numeric) * tens).ceil / tens
precision <= 0 ? result.to_i : result
})