DataBlade® API functions for decimal conversion
The DataBlade®
API library
provides the following functions that convert between a text (string)
representation of a decimal or monetary value and its binary (internal)
equivalent.
DataBlade® API Function | Converts from | Converts to |
---|---|---|
mi_decimal_to_string() | DECIMAL (mi_decimal) | Decimal string |
mi_money_to_string() | MONEY (mi_money) | Interval string |
mi_string_to_decimal() | Decimal string | DECIMAL (mi_decimal) |
mi_string_to_money() | Monetary string | MONEY (mi_money) |
Server only: The mi_decimal_to_string(), mi_money_to_string(), mi_string_to_decimal(),
and mi_string_to_money() functions are useful in
the input and output support function of an opaque data type that
contains mi_decimal or mi_money values. They allow you
to convert fixed-point (DECIMAL or MONEY) values between their external
format (text) and their internal format (dec_t) when transferred
to and from client applications.
The mi_decimal_to_string(), mi_money_to_string(), mi_string_to_decimal(), and mi_string_to_money() functions use the current processing locale to handle locale-specific formats in the decimal or monetary string. For more information, see the Informix® GLS User's Guide.