Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_tinkoff-invest-volume-analysis-robot-master/utils/format_util.py
5929 views
1
from tinkoff.invest import Quotation
2
from tinkoff.invest.utils import quotation_to_decimal
3
4
5
def quotation_to_float(quotation: Quotation):
6
return float(quotation_to_decimal(quotation))
7
8
9
def fixed_float(number: float) -> str:
10
return f"{number:.3f}"
11
12