Table Of Contents

Decimal String to Number (G Dataflow)

Last Modified: January 9, 2017

Converts the numeric characters in a string to a decimal integer.

connector_pane_image
datatype_icon

string

The string that you want to convert. This input can also be any data type that contains only strings, such as an array or cluster of strings.

datatype_icon

offset

The number of bytes into the input string at which this node begins its operation.

The offset of the first byte in the input string is 0. If offset is beyond the end of the input string, this node returns an empty string.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

Default: 0

datatype_icon

default

A numeric value whose representation determines the representation of number.

Default: 32-bit signed integer

datatype_icon

offset past number

The index in string of the first byte following the number.

If string is an array of strings, offset past number reflects the offset within the last string.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

datatype_icon

number

The result of converting string into a number. The structure of number matches the structure of string. For example, if string is an array of strings, number is an array of numbers.

If the input string represents a number outside the range of the representation of this output, this output returns the maximum or minimum value for the representation. For example, if the input string is 300, and the representation of this output is an 8-bit signed integer, this output returns 127.

The following table shows how the values of string, offset, and default affect number.
string offset default offset past number number Comments
13ax 0 0 2 13
–4.8bcde conversion 0 0 2 –4 Because an integer is being converted, conversion stops at the decimal point.
a49b 0 –9 0 –9 default is used since no digits were read.

Where This Node Can Run:

Desktop OS: Windows

FPGA: All devices (only within an Optimized FPGA VI)


Recently Viewed Topics