Number with a fallback
FreeLogic@rabbinatix/number-with-a-fallback by Rabbinatixupdated Oct 4, 2026
Reads a number from text, or uses a fallback (0 when none is given).
To Number says whether the text was a number (valid); blank text counts as no number here. Default Value supplies 0 when no fallback is given.
Shows: To Number with valid, Default Value, Is Empty, NOT, AND, Select.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Number with a fallback. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
text: Text
fallback: Number (may be empty)
Outputs
value: Number
parsed: Yes / No
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 3 outputs. step 1 of 8
Number with a fallback
text
fallback
To Number, Data. 1 input, 2 outputs. step 2 of 8
To Number
value
result
valid
Is Empty, Validation. 1 input, 1 output. step 3 of 8
Is Empty
value
result
NOT, Operators. 1 input, 1 output. step 4 of 8
NOT
value
result
AND, Operators. 2 inputs, 1 output. step 5 of 8
AND
A
B
result
Default Value, Data. 2 inputs, 2 outputs. step 6 of 8
Default Value
value
fallback
result
isSet
Select, Data. 3 inputs, 1 output. step 7 of 8
Select
condition
if true
if false
value
Return, Input / output. 3 inputs, 0 outputs. step 8 of 8
Return
value
parsed
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 3/3 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| A number | {"text":"12.5","fallback":null} | {"value":12.5,"parsed":true} | |
| Text, with a fallback | {"text":"abc","fallback":7} | {"value":7,"parsed":false} | |
| Blank, no fallback | {"text":" ","fallback":null} | {"value":0,"parsed":false} |
Try it
Versions
In this package
Number with a fallback (entry)
