just gonna do this ``` searchResults.sortByDescend...
# getting-started
o
just gonna do this
Copy code
searchResults.sortByDescending {
                    if (it.negotiated_price != null) {
                        100 - ((it.negotiated_price!!.toInt() / it.price) * 100)
                    } else {
                        it.price
                    }
                }
s
Isnt it a bit weird that you are sorting discounts in percentage versus absolute prices ??
o
hmmm not sure what you mean
ahh ok
youre right
n
(it.negotiated_price?.toInt() ?: price) / it.price
Also,
negotiated_price
is named improperly for a variable. It should be named
negotiatedPrice