ProtoFlux:To String: Difference between revisions

From Resonite Wiki
mNo edit summary
Added links and a suggestion note, plus other fixes.
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:ProtoFlux:Strings]]
{{#Invoke:ProtoFlux|GenerateUI
{{#Invoke:ProtoFlux|GenerateUI
|Name=To String
|Name=To String
Line 16: Line 14:
|}}
|}}


== Usage ==
The <code>To String</code> node turns various [[:Category:Type|types]], including objects, into [[Type:String|strings]]. In general, this will match the string that a [[ProtoFlux:Display|display node]] displays. Use cases include HUDs that involve numbers, such as turning your FPS into text for a display, or readouts of objects or values.
You can use this node for turning values into strings, even an object. Turning an object into a string is useful for taking what you see in a display node for a value directly into a string object.
You can also use this for huds, like turning your FPS into text for a display, or readouts of objects or values.


== Inputs == <!--T:3-->
{{Note|If you are looking to take a string and make it into a value instead, try [[ProtoFlux:Parse|Parse]].|suggestion}}
 
== Inputs ==


=== V (Generic) ===
=== V (Generic) ===
The value to turn into a string.
The value to turn into a string.


=== Format (String) ===
=== Format ([[Type:String|String]]) ===
A [https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting#composite-format-string Composite Format String].
A [https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting#composite-format-string Composite Format String].


=== FormatProvider (IFormatProvider) ===
=== FormatProvider ([[Type:FormatProvider|IFormatProvider]]) ===
The locale to use for the output. Defaults to the invariant culture.
The locale to use for the output. Defaults to the invariant culture.


== Outputs == <!--T:3-->
== Outputs ==


=== * (String) ===
=== * ([[Type:String|String]]) ===
The value as a string following the format.
The value as a string following the format.


Line 41: Line 39:
File:Protoflux_example_to_string_2.webp|Four examples of converting various objects to string. Note how, in general, the output matches what the display node outputs.
File:Protoflux_example_to_string_2.webp|Four examples of converting various objects to string. Note how, in general, the output matches what the display node outputs.
</gallery>
</gallery>
[[Category:ProtoFlux:Strings]]

Latest revision as of 23:16, 15 April 2024

To String
V
*
Format
FormatProvider
Strings

The To String node turns various types, including objects, into strings. In general, this will match the string that a display node displays. Use cases include HUDs that involve numbers, such as turning your FPS into text for a display, or readouts of objects or values.

If you are looking to take a string and make it into a value instead, try Parse.

Inputs

V (Generic)

The value to turn into a string.

Format (String)

A Composite Format String.

FormatProvider (IFormatProvider)

The locale to use for the output. Defaults to the invariant culture.

Outputs

* (String)

The value as a string following the format.

Examples