CompactNumberTypeFormat Method |
Namespace: KSPDev.GUIUtils.TypeFormatters
public static string Format( double value, string format = null )
Debug.Log(CompactNumberType.Format(0.051)); // Prints: "Value is: 0.051" Debug.Log(CompactNumberType.Format(0.45)); // Prints: "Value is: 0.45" Debug.Log(CompactNumberType.Format(95.45)); // Prints: "Value is: 95.5" Debug.Log(CompactNumberType.Format(120.45)); // Prints: "Value is: 121" Debug.Log(CompactNumberType.Format(9535.45)); // Prints: "Value is: 9,536"
Debug.Log(DistanceType.Format(1234.5678, format: "0.0000")); // Prints: "1234.5678" Debug.Log(DistanceType.Format(1234.5678, format: "0.00")); // Prints: "1234.57" Debug.Log(DistanceType.Format(1234.5678, format: "#,##0.00")); // Prints: "1,234.57"