Added hashCode() implementation to equal equals()

This commit is contained in:
dankito 2020-08-31 14:21:10 +02:00
parent 4638de1714
commit fba3c68ef2
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,10 @@ actual class BigDecimal(val decimal: NSDecimalNumber) : Comparable<BigDecimal> {
return super.equals(other) return super.equals(other)
} }
override fun hashCode(): Int {
return decimal.hashCode()
}
override fun toString(): String { override fun toString(): String {
return decimal.description ?: decimal.descriptionWithLocale(NSLocale.currentLocale) return decimal.description ?: decimal.descriptionWithLocale(NSLocale.currentLocale)