0

I have a Stocks model and I'm using values as such:

Stock.objects.values("ticker", "stock", "exchange__exchange_code", "earnings_yield", "roic")

The earnings_yield and roic values are stored in my db as decimal, and Django returns their type as such:

{'ticker': 'AAPL', 'stock': 'Apple', 'exchange__exchange_code': 'NASDAQ', 'earnings_yield': Decimal('0.0000'), 'roic': Decimal('0.0000')}

How can I convert the 'roic': Decimal('0.0000') and get back 'roic': 0.0000 instead?

erikvm
  • 858
  • 10
  • 30

0 Answers0