ProtoFlux:Format Quantity: Difference between revisions

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


The '''Format Quantity''' node takes in a unit of measurement as its type, along with the string formats to decorate the output string, as well as an option to use long names. Then it returns a [[Type:string|string]] formatted in a way that shows the unit and amount.
The '''Format Quantity''' node takes in value as a [[Quantity Types|quantity type]], the unit in which the quantity should be displayed as a [[Type:string|string]], as well as wether to use the unit's long name instead of the short form. It returns a formatted [[Type:string|string]] containing the quantity value in the specified unit.


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 ==


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


The unit of measurement type value.
The quantity value.


=== FormatUnit ([[Type:string|string]]) ===  
=== FormatUnit ([[Type:string|string]]) ===  


The string used to format the unit in a certain way.
The unit in which the quantity should be displayed.


=== FormatNumber ([[Type:string|string]]) ===  
=== FormatNumber ([[Type:string|string]]) ===  


The string used to format the number in a certain way.
A format string for the number of the quantity.


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


Should we use long names for this unit?
Wether to use the unit's long name instead of the short form.


== Outputs ==
== Outputs ==

Latest revision as of 14:52, 8 September 2024

Format Quantity <Type>
Value
*
FormatUnit
FormatNumber
UseLongNames
Quantity

The Format Quantity node takes in value as a quantity type, the unit in which the quantity should be displayed as a string, as well as wether to use the unit's long name instead of the short form. It returns a formatted string containing the quantity value in the specified unit.

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

Inputs

Value (Quantity)

The quantity value.

FormatUnit (string)

The unit in which the quantity should be displayed.

FormatNumber (string)

A format string for the number of the quantity.

UseLongNames (bool)

Wether to use the unit's long name instead of the short form.

Outputs

* (double)

The formatted string of that provided unit type.