Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IFormattingInfo

Contains all necessary info for formatting a value
Read time 1 minuteLast updated 16 hours ago

Definition

public interface IFormattingInfo

Remarks

In "{Items.Length:choose(1,2,3):one|two|three}", the IFormattingInfo.CurrentValue would be the value of "Items.Length", the IFormattingInfo.FormatterOptions would be "1,2,3", and the IFormattingInfo.Format would be "one|two|three".

Properties

Property

Description

AlignmentAlignment inserts spaces into the output to ensure consistent length. Positive numbers insert spaces to the left, to right-align the text. Negative numbers insert spaces to the right, to left-align the text. This should only work with the Default Formatter, but is optional with custom formatters. This is primarily for compatibility with String.Format.
CurrentValueThe current value that is to be formatted.
FormatThis format specifies how to output the IFormattingInfo.CurrentValue.
FormatDetailsInfrequently used details, often used for debugging
FormatterOptionsWhen a named formatter is used, this will hold the options. For example, in "{0:choose(1,2,3):one|two|three}", FormatterOptions is "1,2,3".
PlaceholderContains all the details about the current placeholder.

Methods

Method

Description

FormatAsChildCreates a child IFormattingInfo from the current IFormattingInfo instance and invokes formatting with SmartFormatter with the child as parameter.
FormattingExceptionCreates a IFormattingInfo.FormattingException associated with the IFormattingInfo.Format.
WriteWrites a ReadOnlySpan_1 text to the output.