ComfyUI > Nodes > ComfyUI Level Pixel > Convert String To Number [LP]

ComfyUI Node: Convert String To Number [LP]

Class Name

StringToNumber|LP

Category
LevelPixel/Conversion
Author
LevelPixel (Account age: 647days)
Extension
ComfyUI Level Pixel
Latest Updated
2026-02-24
Github Stars
0.03K

How to Install ComfyUI Level Pixel

Install this extension via the ComfyUI Manager by searching for ComfyUI Level Pixel
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Level Pixel in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Convert String To Number [LP] Description

Converts string numbers to integers/floats, with options for rounding, enhancing numerical processing.

Convert String To Number [LP]| Convert String To Number [LP]:

The StringToNumber| Convert String To Number [LP] node is designed to convert a string representation of a number into both integer and floating-point formats. This node is particularly useful when dealing with data that is initially in string format but needs to be processed numerically. By providing a seamless conversion, it allows you to handle numerical operations more efficiently within your workflow. The node also offers flexibility in how the integer conversion is handled, allowing you to specify whether the number should be rounded, rounded down, or rounded up. This feature is especially beneficial when precision in numerical representation is crucial, such as in graphical computations or data analysis tasks.

Convert String To Number [LP]| Convert String To Number [LP] Input Parameters:

string

The string parameter is the input that represents the number you wish to convert. It should be a valid string that can be interpreted as a number, either an integer or a floating-point. The default value is an empty string, which means you need to provide a valid number string for the node to function correctly. This parameter is crucial as it directly affects the conversion process and the resulting numerical outputs.

round_integer

The round_integer parameter determines how the conversion from a floating-point number to an integer should be handled. It offers three options: "round", "round down", and "round up". Choosing "round" will round the number to the nearest integer, "round down" will truncate the number towards zero, and "round up" will increase the number to the next integer if it is positive. This parameter is important for controlling the precision and accuracy of the integer output, especially in scenarios where rounding behavior can impact the outcome of subsequent operations.

Convert String To Number [LP]| Convert String To Number [LP] Output Parameters:

INT

The INT output is the integer representation of the input string. Its value is determined by the round_integer parameter, which specifies how the conversion should be handled. This output is essential for tasks that require integer values, such as indexing or discrete calculations, and provides a straightforward way to handle numerical data that originates from string inputs.

FLOAT

The FLOAT output is the floating-point representation of the input string. It provides a precise numerical value that can be used in calculations requiring decimal precision. This output is particularly useful in scenarios where the exact numerical value is needed, such as in mathematical computations or when dealing with fractional data.

Convert String To Number [LP]| Convert String To Number [LP] Usage Tips:

  • Ensure that the input string is a valid numerical representation to avoid conversion errors.
  • Use the round_integer parameter to control the precision of the integer output based on your specific needs, such as rounding up for positive numbers when necessary.
  • Consider using this node when you need to convert user input or data from external sources that are in string format into numerical values for further processing.

Convert String To Number [LP]| Convert String To Number [LP] Common Errors and Solutions:

[Error] String To Number. Not a number.

  • Explanation: This error occurs when the input string cannot be interpreted as a valid number. It may contain non-numeric characters or be improperly formatted.
  • Solution: Verify that the input string is a valid numerical representation. Remove any non-numeric characters and ensure the format is correct for conversion.

Convert String To Number [LP] Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Level Pixel
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Convert String To Number [LP]