Parse Number
Last updated
Last updated
The Parse Number node converts a string representation of a number into an actual number value. If the conversion fails (resulting in NaN), the node throws an error.
Value
The string to convert to a number
String
Yes
Value
The converted number value
Number
Drag the Parse Number node into your graph.
Connect a string value to the "Value" input.
The node attempts to convert the string to a number.
If successful, the number is output.
If the string cannot be parsed as a number, an error is thrown.
This node is stricter than JavaScript's built-in parsing as it throws an error on invalid input.
Use this node when you need to ensure numerical operations will work correctly.
Consider using a Try/Catch node to handle potential parsing errors gracefully.
Parse unit: For extracting both the number and unit from a value.
Pass unit: For adding a unit to a number.
Number To String: For converting in the opposite direction.
User Input Validation: Convert user-provided string inputs to numbers for calculations.
Data Cleaning: Ensure values from external sources are proper numbers before processing.
Configuration Parameter Processing: Convert string configuration values to numbers for use in calculations.