From 060bcd03661ec469fb7c33cd32d6b5eb1e7badf1 Mon Sep 17 00:00:00 2001 From: mdrlzy Date: Tue, 3 Sep 2024 01:32:52 +0600 Subject: [PATCH] Fix NumberFormatException when "." is the only input --- app/src/main/java/dev/arkbuilders/rate/data/CurrUtils.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/dev/arkbuilders/rate/data/CurrUtils.kt b/app/src/main/java/dev/arkbuilders/rate/data/CurrUtils.kt index cb5dba62d..d2d33a424 100644 --- a/app/src/main/java/dev/arkbuilders/rate/data/CurrUtils.kt +++ b/app/src/main/java/dev/arkbuilders/rate/data/CurrUtils.kt @@ -80,5 +80,6 @@ fun String.toDoubleSafe() = when { this == "" -> 0.0 this == "-" -> 0.0 + this == "." -> 0.0 else -> this.toDouble() }