GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The DecimalToInteger function converts a string containing a decimal number to an integer value.
Syntax/Parameters
Syntax
long = DecimalToInteger ( string data | wstring data);
Parameters
data
A string or wstring containing a decimal number.
Return Value
Returns a long containing the integer equivalent of value or 0 on failure. Use the GetLastError function to retrieve error information.
Remarks
The DecimalToInteger function converts a string containing a decimal number to an integer; this should not be confused with the DecimalToFloat function, which converts a string containing a floating-point number to a floating-point data type. This function handles the sign appropriately. The inclusion of any other characters aside from digits and sign will cause the DecimalToInteger function to fail. Because this function can return 0 as both a permissible value and as an error, use the GetLastError function to ensure the function succeeded.
Decimal numbers may lead with a ‘-’ character to indicate a negative number.
This function returns a 64-bit value. Depending on the source value parameter, if the return value is stored in an int type (or smaller), the value will be truncated if it exceeds the 32-bit integer size. Such a condition is considered a runtime warning which will be placed in the program log.
If the string parameter cannot be converted to an integer, the GetLastError function will return ERROR_SYNTAX.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.