class OCI8::BindType::Number

get/set Number (for OCI8::SQLT_NUM)

def self.create(con, val, param, max_array_size)

def self.create(con, val, param, max_array_size)
  if param.is_a? OCI8::Metadata::Base
    precision = param.precision
    scale = param.scale
  end
  if scale == -127
    if precision == 0
      # NUMBER declared without its scale and precision. (Oracle 9.2.0.3 or above)
      klass = OCI8::BindType::Mapping[:number_no_prec_setting]
    else
      # FLOAT or FLOAT(p)
      klass = OCI8::BindType::Float
    end
  elsif scale == 0
    if precision == 0
      # NUMBER whose scale and precision is unknown
      # or
      # NUMBER declared without its scale and precision. (Oracle 9.2.0.2 or below)
      klass = OCI8::BindType::Mapping[:number_unknown_prec]
    else
      # NUMBER(p, 0)
      klass = OCI8::BindType::Integer
    end
  else
    # NUMBER(p, s)
    if precision < 15 # the precision of double.
      klass = OCI8::BindType::Float
    else
      # use BigDecimal instead
      klass = OCI8::BindType::BigDecimal
    end
  end
  klass.new(con, val, nil, max_array_size)
end