2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

android: Expose MemoryUtil size formatting function

This commit is contained in:
t895 2023-12-10 20:47:32 -05:00
parent dbddc627d4
commit ca5b135ddf
2 changed files with 3 additions and 2 deletions

View file

@ -27,13 +27,13 @@ object MemoryUtil {
const val Pb = Tb * 1024 const val Pb = Tb * 1024
const val Eb = Pb * 1024 const val Eb = Pb * 1024
private fun bytesToSizeUnit(size: Float, roundUp: Boolean = false): String = fun bytesToSizeUnit(size: Float, roundUp: Boolean = false): String =
when { when {
size < Kb -> { size < Kb -> {
context.getString( context.getString(
R.string.memory_formatted, R.string.memory_formatted,
size.hundredths, size.hundredths,
context.getString(R.string.memory_byte) context.getString(R.string.memory_byte_shorthand)
) )
} }
size < Mb -> { size < Mb -> {

View file

@ -414,6 +414,7 @@
<!-- Memory Sizes --> <!-- Memory Sizes -->
<string name="memory_byte">Byte</string> <string name="memory_byte">Byte</string>
<string name="memory_byte_shorthand">B</string>
<string name="memory_kilobyte">KB</string> <string name="memory_kilobyte">KB</string>
<string name="memory_megabyte">MB</string> <string name="memory_megabyte">MB</string>
<string name="memory_gigabyte">GB</string> <string name="memory_gigabyte">GB</string>