Fix zero decimal formatting

This commit is contained in:
DBotThePony 2023-12-29 10:51:13 +07:00
parent a1515d54c4
commit 2276f0ef45
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1350,8 +1350,10 @@ sealed class Decimal : Number(), Comparable<Decimal> {
}
override fun toString(decimals: Int): String {
if (decimals <= 0)
if (decimals == 0)
return "0"
else if (decimals < 0)
return "0.0"
else
return "0." + "0".repeat(decimals)
}