Add float initializer to FtPrecise

This commit is contained in:
Matthias
2022-08-10 11:29:04 +00:00
parent e7cb1b7375
commit ed004236ce
3 changed files with 12 additions and 4 deletions

View File

@@ -1,9 +1,12 @@
"""
Slim wrapper around ccxt's Precise (string math)
To have imports from freqtrade
To have imports from freqtrade - and support float initializers
"""
from ccxt import Precise
class FtPrecise(Precise):
pass
def __init__(self, number, decimals=None):
if not isinstance(number, str):
number = str(number)
super().__init__(number, decimals)