• Operand
  • ./bin/ganged/upon.

gram: luck

> ./sample-data/stonks-portfolio.2.highlighter

Lenses
(coming soon!)


{
  "id": "stonks-portfolio.2",
  "name": "holdings",
  "properties": [
    {
      "name": "$",
      "formula": "${/\\\\w+/:ticker} {number:shares}@${/[\\\\d\\.]+/:cost}",
      "visibility": "HIDDEN"
    },
    {
      "name": "currentPrice",
      "formula": "TextOfHighlight(ticker) === \"GME\" ? 40 : 20",
      "visibility": "HIDDEN"
    },
    {
      "name": "total",
      "formula": "currentPrice * ParseInt(shares)",
      "visibility": "HIDDEN"
    },
    {
      "name": "change",
      "formula": "Round((currentPrice - cost) / cost, 2)",
      "visibility": "HIDDEN"
    },
    {
      "name": "changePercent",
      "formula": "change >= 0 ? `+${change * 100}%`\n: `${change * 100}%`",
      "visibility": "HIDDEN"
    },
    {
      "name": "col3",
      "formula": "`-> $${currentPrice} (${changePercent}) = ${total}`",
      "visibility": "INLINE"
    }
  ]
}