Order numbers mixing two dif attributes

Hello! This is my first post.
I’m trying to use Algolia to order my products but in a merged way using two number values.
In my case I have, price and price with discount, something like this:

{
“products”: [
{
“title”: “product0”,
“price”: “195”,
“discountPrice”: null
},
{
“title”: “product1”,
“price”: “300”,
“discountPrice”: “150”
},
{
“title”: “product2”,
“price”: “170”,
“discountPrice”: null
},
{
“title”: “product3”,
“price”: “175”,
“discountPrice”: “160”
},
{
“title”: “product4”,
“price”: “200”,
“discountPrice”: “190”
}
}

And I want to order my products like:
Product1(discountPrice:150),
Product3(discountPrice:160),
Product2(price:170),
Product4(discountPrice:190),
Product0(price:195).

There is a way to order descendent mixing or merging two diferent attributes(If my product has a discount, algolia take that value to order, if not take the price value)?

Thanks in advance!!
Luciano.