Owning Palette: Numeric Functions
Use the Conversion VIs and functions to convert data types.
When these functions convert a floating-point number to an integer, they round the output to the nearest integer, or the nearest even integer if the fractional part is 0.5. If the result is out of range for the integer, these functions return the minimum or maximum value for the integer type. When these functions convert an integer to a smaller integer, they copy the least-significant bits without checking for overflow. When they convert an integer to a larger integer, they extend the sign of a signed integer and pad an unsigned integer with zeros.
Use caution when you convert numbers to smaller representations, particularly when converting integers, because the LabVIEW conversion routines do not check for overflow.
| Palette Object | Description |
|---|---|
| Boolean Array To Number | Converts a Boolean array to a 32-bit unsigned integer by interpreting the array as the two's complement of the binary representation of an integer, with the first element of the array being the least significant bit. |
| Boolean To (0,1) | Converts a Boolean FALSE or TRUE value to a 16-bit integer with a value of 0 or 1, respectively. |
| Byte Array To String | Converts an array of unsigned bytes representing ASCII characters into a string. |
| Cast Unit Bases | Changes the base units associated with the input to the base units associated with unit and returns the results at the output terminal. |
| Color to RGB | Resolves any color input, including system colors, into its respective red, green, and blue components. |
| Convert Unit | Converts a physical number (a number that has a unit) to a pure number (a number with no units) or a pure number to a physical number. Right-click the function and select Build Unit String from the shortcut menu to build and edit a string of units. |
| Number To Boolean Array | Converts an integer or fixed-point number to a Boolean array. If you wire an integer to number, Boolean array returns an array of 8, 16, 32, or 64 elements, depending on the number of bits in the integer. If you wire a fixed-point number to number, the size of the array that Boolean array returns equals the word length of the fixed-point number. The 0th element of the array corresponds to the least significant bit of the two's complement of the binary representation of the integer. |
| RGB to Color | Converts a red, green, and blue value from 0 to 255 to the corresponding RGB color. |
| String To Byte Array | Converts a string into an array of unsigned bytes. |
| To Byte Integer | Converts a number to an 8-bit integer in the range -128 to 127. |
| To Double Precision Complex | Converts a number to a double-precision, complex number. |
| To Double Precision Float | Converts a number to a double-precision, floating-point number. |
| To Extended Precision Complex | Converts a number to an extended-precision, complex number. |
| To Extended Precision Float | Converts a number to an extended-precision, floating-point number. |
| To Fixed-Point | Converts any non-complex number to fixed-point representation. If you do not wire a value to the fixed-point type input or configure the output settings of this function, it returns a signed fixed-point number with a 32-bit word length and a 16-bit integer word length by default. This function saturates the number by default if overflow occurs. |
| To Long Integer | Converts a number to a 32-bit integer in the range –(2^ 31) to (2^ 31)–1. This function rounds all floating-point and fixed-point numeric values to the nearest integer. |
| To Quad Integer | Converts a number to a 64-bit integer in the range –(2^63) to (2^63)–1. |
| To Single Precision Complex | Converts a number to a single-precision, complex number. |
| To Single Precision Float | Converts a number to a single-precision, floating-point number. |
| To Time Stamp | Converts a number to a time stamp. |
| To Unsigned Byte Integer | Converts a number to an 8-bit unsigned integer in the range 0 to 255. |
| To Unsigned Long Integer | Converts a number to a 32-bit unsigned integer in the range 0 to (2^32)–1. |
| To Unsigned Quad Integer | Converts a number to a 64-bit unsigned integer in the range 0 to (2^64)–1. |
| To Unsigned Word Integer | Converts a number to a 16-bit unsigned integer in the range 0 to 65,535. |
| To Word Integer | Converts a number to a 16-bit integer in the range –32,768 to 32,767. |