Formatting an IliValue Object
An
IliValue object can be formatted using the
format member function. This is shown in the following example:
IliString stringBuf;
IliFormat fmt(“#,##0.00 Yens”);
IliValue value = 5.677;
value.format(stringBuf, fmt);
IlvPrint(“Price: %s”, (const char*)stringBuf);
You can also use the
getFormatted member function, which does not require an
IliString parameter to store the result. An example is shown in the following code:
IliFormat fmt(“#,##0.00 Yens”);
IliValue value = 5.677;
const char* result = value.getFormatted(fmt);
IlvPrint(“Price: %s, result);
Note that the getFormatted member function returns its result in a static character buffer. This result must therefore be used immediately after the call.
Published date: 05/24/2022
Last modified date: 02/24/2022