getFloat

abstract suspend fun getFloat(key: String, defValue: Float): Float

Reads the Float value stored under key, returning defValue if absent.

Return

The stored float, or defValue.

Parameters

key

Storage key to look up.

defValue

Value returned when key is not found.

Throws

if the stored value cannot be read or cast to Float.

for any other storage-layer error.

CancellationException

if the calling coroutine is cancelled.