Skip to content

Converters ​

Every step a converter can have, what goes in and what comes out, every operation and formula function, and ready-made chains for the things graphics need most.

How to build one is on Converter; what converters are for is on Converters.

A converter with one step, Number to text: Decimals and the Round, Trim zeros and 1,000 options

Steps: what goes in, what comes out ​

A step takes what the step above it gave. Put the steps in an order whose types follow on: a Number to text step hands text to the next step, so a Round after it has nothing to round.

StepTakesGives
Number to textNumberText
Map a rangeNumberNumber
RoundNumberNumber
CalculateNumberNumber
FormulaNumberNumber
Ease changes (smooth counter)NumberNumber, arriving gradually
Degrees to radiansNumber, in degreesNumber, in radians
Normalize (percent to 0–1)Number, a percentageNumber, 0–1
Text to numberTextNumber
Pad textTextText
Trim textTextText
Remove trailing zerosTextText
Not (negate boolean)True or falseThe opposite
Fire trigger on changeAny valueFires a trigger
List lengthListNumber
Number to listNumberList of that many items

Calculate: the operations ​

Calculate does one sum with the value and a second number: a Constant you type, or another number property.

OperationGives
Addvalue + number
Subtractvalue − number
Multiplyvalue × number
Dividevalue ÷ number
ModuloWhat is left over after dividing: 7 modulo 3 is 1
Powervalue to the power of the number
Square rootThe square root of the value
Expe to the power of the value
LogThe natural logarithm of the value
Cos, Sin, TanThe cosine, sine or tangent of the value, in radians
Acos, Asin, AtanThe angle, in radians, whose cosine, sine or tangent is the value

Angles are in radians. For an angle in degrees, put a Degrees to radians step first, or multiply by 0.01745 (π ÷ 180).

Formula: operators and functions ​

A formula is written out of tokens: value, numbers, operators, functions, brackets and commas. Use brackets rather than relying on which operator goes first: (value + 1) × 100 says what it means.

Operators, from + Operator:

SymbolDoes
+ - × ÷Add, subtract, multiply, divide
modWhat is left over after dividing
^To the power of
sqrt exp logSquare root, e to the power of, natural logarithm
cos sin tan acos asin atan atan2Angles, in radians
round floor ceilTo the nearest whole number, down, up

Functions, from + Function. Each opens a bracket: close it with + ), and separate values with + ,.

FunctionGives
min(a, b)The smaller of the two
max(a, b)The larger
round(a) floor(a) ceil(a)To the nearest whole number, down, up
sqrt(a)The square root
pow(a, b)a to the power of b
exp(a) log(a)e to the power of a; the natural logarithm
cos(a) sin(a) tan(a)Trigonometry, in radians
acos(a) asin(a) atan(a)The angle, in radians
atan2(y, x)The angle of the point x, y, in radians
random(A random number. Random re-rolls says when it changes: Once, Every frame, or When the source changes

A number token can read another property instead of a fixed number: its row then reads Property. So value ÷ total × 100 can divide by a total that arrives with the data.

Recipes ​

You wantSteps
12500 shown as 12,500Number to text: Decimals 0, 1,000 on
0.412 shown as 41.2Calculate Multiply 100 → Number to text: Decimals 1
A share of a total, as a percentageFormula value ÷ total × 100 → Number to text
A bar as long as a share: 0–1 → 0–400 pxMap a range: in 0 to 1, out 0 to 400, Clamp both
A score that counts upEase changes (smooth counter) Duration 1 → Number to text Decimals 0
7 shown as 07Number to text → Pad text: Length 2, Pad with 0
3.40 shown as 3.4Number to text → Remove trailing zeros, or Trim zeros in Number to text
A number that arrives as text, "42"Text to number
Show when off is trueNot (negate boolean)
How many rows a list hasList length
A needle turned by a value in degreesNothing: bind it straight to the rotation, which reads degrees
A percentage as 0–1, 42 → 0.42Normalize (percent to 0–1)

Things to know ​

  • One converter, many bindings. Changing it changes every binding that uses it. For a variation, duplicate it.
  • The last step decides the type. A text needs text out of the last step, a width needs a number.
  • Deleting a converter leaves its bindings working, showing the value unchanged.
  • A bound rotation reads degrees. Binding a number to Rotation puts Degrees to radians on it for you, and the row reads speed (degrees). For data in radians, untick Value is in degrees in the bind menu. See Inspector.
  • Degrees to radians (× π/180) and Normalize (percent to 0–1) (× 0.01) show their operation and value, and neither can be changed. For any other fixed sum, Calculate or Formula is the step to use.

See also ​

airZ Editor manual