Sha256: 5c29265ebb7dde3394939aec9f1492a1102543ad70b5e6c8311b6529dd20577d
Contents?: true
Size: 290 Bytes
Versions: 9
Compression:
Stored size: 290 Bytes
Contents
require_relative '../function' Dentaku::AST::Function.register(:rounddown, :numeric, lambda { |numeric, precision = 0| precision = precision.to_i tens = 10.0**precision result = (Dentaku::AST::Function.numeric(numeric) * tens).floor / tens precision <= 0 ? result.to_i : result })
Version data entries
9 entries across 9 versions & 1 rubygems