Module: Kernel

Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#OraNumber(expr = nil, fmt = nil, nlsparam = nil) ⇒ OraNumber

Converts expr to a value of OraNumber. The expr can be a Numeric value or a String value. If it is a String value, optional fmt and nlsparam. is used as Oracle SQL function TO_NUMBER does.

Examples:

# Numeric expr
OraNumber(123456.789)   # -> 123456.789
# String expr
OraNumber('123456.789') # -> 123456.789
# String expr with fmt
OraNumber('123,456.789', '999,999,999.999') # -> 123456.789
# String expr with fmt and nlsparam
OraNumber('123.456,789', '999G999G999D999',  "NLS_NUMERIC_CHARACTERS = ',.'") # -> 123456.789

Parameters:

Returns:

Since:

  • 2.0.3


755
756
757
758
759
760
# File 'ext/oci8/ocinumber.c', line 755

static VALUE onum_f_new(int argc, VALUE *argv, VALUE self)
{
    VALUE obj = rb_obj_alloc(cOCINumber);
    rb_obj_call_init(obj, argc, argv);
    return obj;
}