Skip to content
CCPEDIAby Unity Nodes
App Development

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

3 posts122 viewsLast activity Jul 2022

  1. 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

  2. Stephen

    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
  3. Sarah_Caloobanan

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