Fuel plugin to deploy Sensu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rounddown.rb 222B

1234567
  1. require_relative '../function'
  2. Dentaku::AST::Function.register(:rounddown, :numeric, ->(numeric, precision=0) {
  3. tens = 10.0**precision
  4. result = (numeric * tens).floor / tens
  5. precision <= 0 ? result.to_i : result
  6. })