File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 55from tomlkit .api import comment
66from tomlkit .api import date
77from tomlkit .api import datetime
8+ from tomlkit .api import decimal
89from tomlkit .api import document
910from tomlkit .api import dump
1011from tomlkit .api import dumps
3334 "comment" ,
3435 "date" ,
3536 "datetime" ,
37+ "decimal" ,
3638 "document" ,
3739 "dump" ,
3840 "dumps" ,
Original file line number Diff line number Diff line change 11import datetime as _datetime
22
33from collections .abc import Mapping
4+ from decimal import Decimal
45from typing import IO
56from typing import Iterable
67from typing import Optional
@@ -96,6 +97,11 @@ def integer(raw: Union[str, int]) -> Integer:
9697 return item (int (raw ))
9798
9899
100+ def decimal (raw : Union [str , Decimal , float ]) -> String :
101+ """Create an string item from a ``decimal.Decimal``."""
102+ return item (Decimal (raw ))
103+
104+
99105def float_ (raw : Union [str , float ]) -> Float :
100106 """Create an float item from a number or string."""
101107 return item (float (raw ))
You can’t perform that action at this time.
0 commit comments