How to convert this map value [2.2] to a decimal value?
- Sarah_CaloobananOP
I have this code let price = map (\or → (getMarketBuyPrice(snd or))) setprice
it returns [2.2] but i want convert it to decimal value because it has an error when I try to compare this one to 2.2
- Stephen
It’s difficult to say what would be best here without knowing: why is
setpricea list?There are possibilities like
- comparing every element to 2.2
- same, but also there must be at least one element
- allowing only one-element lists, where the sole element is 2.2
- taking the sum and comparing that to 2.2
- or the average
- checking that there is at least one element that is 2.2, but the other elements can be anything
- more…this list is not exhaustive
- Sarah_Caloobanan
thank you so much for answering. I made something like this List.head [2.2]