Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How to convert this map value [2.2] to a decimal value?Forum ↗

How to convert this map value [2.2] to a decimal value?

App Development3 posts108 viewsLast activity Jul 2022
SA
Sarah_CaloobananOP
Jul 2022

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

ST
Stephen
Jul 2022

It’s difficult to say what would be best here without knowing: why is setprice a list?

There are possibilities like

  1. comparing every element to 2.2
  2. same, but also there must be at least one element
  3. allowing only one-element lists, where the sole element is 2.2
  4. taking the sum and comparing that to 2.2
  5. or the average
  6. checking that there is at least one element that is 2.2, but the other elements can be anything
  7. more…this list is not exhaustive
SA
Sarah_Caloobanan
Jul 2022

thank you so much for answering. I made something like this List.head [2.2]

← Back to Discussions