string A formatted string representation of this vector.
Formats this vector as a string.
Defaults to two digits displayed (format="F2"). For more information, see Microsoft's documentation on Standard numeric format strings.
using UnityEngine;
public class Example : MonoBehaviour { void Start() { Vector2 vector = new Vector2(1, 2); Debug.Log(vector.ToString()); // output displayed as: "(1.00, 2.00)" } }
| Parameter | Description |
|---|---|
| format | A numeric format string. |
string A formatted string representation of this vector.
Formats this vector as a string, using a given numeric format.
| Parameter | Description |
|---|---|
| format | A numeric format string. |
| formatProvider | An object that specifies culture-specific formatting. |
string A formatted string representation of this vector.
Formats this vector as a string, using a given numeric format and culture-specific formatting.