ProtoFlux:Parse Quantity: Difference between revisions

From Resonite Wiki
Created a page for the Parse Quantity node.
 
Updated description and linked to new quantity types page. "QuantityX" doesn't exist in Resonite.
 
Line 14: Line 14:
|}}
|}}


The '''Parse Quantity''' node takes in a string that has our unit of measurement as its contents, along with the string that holds our default unit. Then it returns a parsed unit of measurement value and if it parsed it successfully.
The '''Parse Quantity''' node takes in a [[Type:string|string]] containing a written quantity value, along with the [[Type:string|string]] of the default unit to assume if no explicit unit is present as part of the input string. It returns the parsed quantity value as a [[Quantity Types|quantity type]] and a [[Type:bool|bool]] indicating wether it parsed successfully.


To create a node within this category, keep in mind you want to type <code>QuantityX.</code> at the beginning of your search, and then the unit you want to use. Examples: <code>QuantityX.Mass</code>, <code>QuantityX.Time</code>, and <code>QuantityX.Voltage</code>.
To create this node, you need to specify a valid [[Quantity Types|quantity type]] for its generic parameter. Examples: <code>Mass</code>, <code>Time</code>, and <code>Voltage</code>.


== Inputs ==
== Inputs ==
Line 26: Line 26:
=== DefaultUnit ([[Type:string|string]]) ===  
=== DefaultUnit ([[Type:string|string]]) ===  


The units we are going to try to parse out.
The default unit to assume if no unit is present in the input string.


== Outputs ==
== Outputs ==


=== Value (Pseudo-Generic) ===
=== Value ([[Quantity Types|Quantity]]) ===


Returns the parsed unit of measurement value.
The parsed quantity value.


=== IsParsed ([[Type:bool|bool]]) ===
=== IsParsed ([[Type:bool|bool]]) ===


Returns if this value has been parsed.
Wether the input string was parsed successfully.


[[Category:ProtoFlux:Math:Quantity]]
[[Category:ProtoFlux:Math:Quantity]]

Latest revision as of 14:42, 8 September 2024

Parse Quantity <Type>
Str
Value
DefaultUnit
IsParsed
Quantity

The Parse Quantity node takes in a string containing a written quantity value, along with the string of the default unit to assume if no explicit unit is present as part of the input string. It returns the parsed quantity value as a quantity type and a bool indicating wether it parsed successfully.

To create this node, you need to specify a valid quantity type for its generic parameter. Examples: Mass, Time, and Voltage.

Inputs

Str (string)

The string to parse.

DefaultUnit (string)

The default unit to assume if no unit is present in the input string.

Outputs

Value (Quantity)

The parsed quantity value.

IsParsed (bool)

Wether the input string was parsed successfully.