module SQLite3ExtendFunction::Functions::Floor

SQLite3ExtendFunction::Functions::Floor

Public Class Methods

call(dp) click to toggle source

@param [Integer, Float] dp @return [Integer] @raise [SQLite3::SQLException]

# File lib/sqlite3_extend_function/functions/floor.rb, line 11
def call(dp)
  Float(dp).floor.to_i unless dp.nil?
rescue ArgumentError
  raise SQLite3::SQLException, "invalid input syntax for type double precision: \"#{dp}\""
end