From 2a5c13bcde20cfeca6e35234e7f5dd821aebbc64 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 21 Mar 2023 11:33:16 -0400 Subject: [PATCH] Rename `float_digits()` -> `dec_digits()`, since decimal. --- piker/accounting/_mktinfo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piker/accounting/_mktinfo.py b/piker/accounting/_mktinfo.py index fa606fcb..5d9edbd6 100644 --- a/piker/accounting/_mktinfo.py +++ b/piker/accounting/_mktinfo.py @@ -69,8 +69,9 @@ AssetTypeName: Literal[ # egs. stock, futer, option, bond etc. -def float_digits( - value: float, +def dec_digits( + value: float | str | Decimal, + ) -> int: ''' Return the number of precision digits read from a decimal or float @@ -85,6 +86,9 @@ def float_digits( ) +float_digits = dec_digits + + def digits_to_dec( ndigits: int, ) -> Decimal: