void FormatFixed() { #region VelocityTypeDemo2_FormatFixed Debug.Log(VelocityType.Format(1234.5678, format: "0.0000")); // Prints: "1234.5678m/s" Debug.Log(VelocityType.Format(1234.5678, format: "0.00")); // Prints: "1234.57m/s" Debug.Log(VelocityType.Format(1234.5678, format: "#,##0.00")); // Prints: "1,234.57m/s" #endregion }
void FormatDefault() { #region VelocityTypeDemo2_FormatDefault Debug.Log(VelocityType.Format(0.051)); // Prints: "Speed is: 0.051m/s" Debug.Log(VelocityType.Format(0.45)); // Prints: "Speed is: 0.45m/s" Debug.Log(VelocityType.Format(95.45)); // Prints: "Speed is: 95.5m/s" Debug.Log(VelocityType.Format(120.45)); // Prints: "Speed is: 121m/s" Debug.Log(VelocityType.Format(9535.45)); // Prints: "Speed is: 9.54km/s" #endregion }