Start » Filter Reference » Basic » String » FormatIntegerToString
Module: | FoundationLite |
---|
Creates a string from an integer number using a proper format.
Applications
Name | Type | Range | Description | |
---|---|---|---|---|
inInteger | Integer | Input integer | ||
inDigitCount | Integer | 0 - 100 | How many characters the output string should have at least | |
inTrailingCharacter | String | Defines the trailing character | ||
inForceSignPrinting | Bool | Forces printing the sign of the number even if the number is positive | ||
inSuffix | String | Defines a suffix. Generally it is an unit of value (e.g. mm) | ||
inSystemBase | Integer | 2 - 16 | The base of the numeral system | |
outString | String | Output string |
Examples
inInteger = 200 inDigitCount = 4 inTrailingCharacter = "0" inForceSignPrinting = False inSuffix = "" inSystemBase = 16 |
outString = "00C8" |
In the above example the input value is 200. Formatting is configured for displaying 4-digit hexadecimal number by setting the inDigitCount input. The value of 200 expressed in hexadecimal numeral system is represented as 0xC8. The final result is filled in with zeros.
inInteger = 25 inDigitCount = 4 inTrailingCharacter = "-" inForceSignPrinting = False inSuffix = "" inSystemBase = 10 |
outString = "--25" |
The next example shows you how final representation of a number can be filled with arbitrary chosen sign. First two characters are dashes as defined in inTrailingCharacter.
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inTrailingCharacter has to be a single character in FormatIntegerToString. |
Complexity Level
This filter is available on Basic Complexity Level.
See Also
- FormatRealToString – Creates a string from a real number using a proper format.
- FormatDoubleToString – Creates a string from a double number using a proper format.
- FormatString – Creates a string according to the given format and data.