abs

This block is part of the math group and was last modified in core v10.4.28.

abs v10.4.28

static method returns the absolute value of a number

In pins 1
  • Number required
    number
Out pins 1
  • Number
    number

Outputs the absolute value of the number pin. Numeric strings and booleans coerce (true=1, false=0); an unwired, nil, or non-numeric input outputs nil instead of a number. Example: number="-3.5" -> 3.5.

A typical wiring for abs: the number out pin feeds cast to value.

Studio canvas example for the abs block: typical wiring for abs.

Version history

Introduced in v10.4.28.


Back to math Return to the main group to view all sub-groups Back to number Return to the group to view all blocks within this group