Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited


Changing the Number to Absolute Value

Absolute of 0

					{"blocks":"<xml xmlns=\"\"><block type=\"math_op3\" disabled=\"true\" x=\"-22\" y=\"472\"><value name=\"x\"><shadow type=\"math_number\" disabled=\"true\"><field name=\"NUM\">0</field></shadow></value></block></xml>"}

This block is used to make the value of the number to absolute value.

Parameters: Condition: Number (Default: 0)

Output: Number

Sample code:

					{"blocks":"<xml xmlns=\"\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"basic_consoleLogNum\"><value name=\"num\"><block type=\"math_op3\"><value name=\"x\"><shadow type=\"math_number\"><field name=\"NUM\">-10</field></shadow></value></block></value></block></statement></block></xml>"}

The output:

Absolute - Output
Previous Converting the Number to an Approximate Value
Next Choosing the Random Value