Integer to decimal

Type conversion Pure
Integer to decimal
Value 0
Result

Description

Pure function widening an integer to a decimal.

When to use

Use Integer to decimal when an integer value needs to be passed to a node or calculation that requires a decimal — for example, before performing decimal arithmetic or producing a percentage. Because widening from integer to decimal is lossless, this conversion never fails. For the narrowing direction (decimal to integer, which truncates), use Decimal to integer.

Pins

Input pins

Pin Type Default Notes
Value integer 0 The integer to widen. No precision is lost in this direction.

Output pins

Pin Type Notes
Result decimal The same numeric value as a decimal (e.g. 5 becomes 5.0).

Example

Compute a percentage by dividing an integer count by a decimal total. Wire the Result output of Array length into the Value input of Integer to decimal, then use the Result output in decimal division. The widening is lossless, so the subsequent division produces a fractional percentage rather than a truncated integer quotient.

See also