The mi_decimal_to_binary() function

The mi_decimal_to_binary() function converts a text (string) representation of a decimal value to its binary (internal) DECIMAL representation.

Syntax

mi_decimal *mi_decimal_to_binary(decimal_string)
   mi_lvarchar *decimal_string;
decimal_string
A pointer to the decimal string to convert to its internal DECIMAL format.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_decimal_to_binary() function converts the decimal string that decimal_string references to the internal DECIMAL value. An internal DECIMAL value is the format that the database server uses to store a value in a DECIMAL column of the database. This format can represent both fixed-point and floating-point decimal numbers.

For GLS, the mi_decimal_to_binary() function accepts the decimal string in the numeric format of the current processing locale. The function also performs any code-set conversion necessary between the current processing locale and the target locale.
Important: The mi_decimal_to_binary() function is supported only for compatibility with earlier versions of existing DataBlade® API modules. The DataBlade API will eventually discontinue support for this function. Use the mi_string_to_decimal() function in any new DataBlade API modules.

Return values

An mi_decimal pointer
A pointer to the internal DECIMAL representation that mi_decimal_to_binary() has created.
NULL
The function was not successful.