Version: 5.5 (switch to 5.6b)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

EditorUtility.FormatBytes

public static string FormatBytes(int bytes);

Description

Returns a text for a number of bytes.

	// prints "100 bytes"
	print (EditorUtility.FormatBytes(100));

// prints "2.0 KB" print (EditorUtility.FormatBytes(2048));