The mi_string_to_decimal() function

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

Syntax

mi_decimal *mi_string_to_decimal(decimal_string)
   mi_string *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_string_to_decimal() function converts the decimal string that decimal_string references to its internal DECIMAL (mi_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.
Important: The mi_string_to_decimal() function replaces the mi_decimal_to_binary() function for string-to-internal-DECIMAL conversion in DataBlade® API modules.

The mi_string_to_decimal() function accepts the decimal string in the numeric format of the current processing locale. For more information, see the HCL OneDB™ GLS User's Guide.

For more information about how to convert decimal strings to internal DECIMAL format, see the HCL OneDB DataBlade API Programmer's Guide.

Return values

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