File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-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 33import datetime as _datetime
44
55from collections .abc import Mapping
6+ from decimal import Decimal
67from typing import IO
78from typing import Iterable
89
@@ -99,6 +100,10 @@ def float_(raw: str | float) -> Float:
99100 """Create an float item from a number or string."""
100101 return item (float (raw ))
101102
103+ def decimal (raw : str | Decimal | float ) -> String :
104+ """Create an string item from a ``decimal.Decimal``."""
105+ return item (Decimal (raw ))
106+
102107
103108def boolean (raw : str ) -> Bool :
104109 """Turn `true` or `false` into a boolean item."""
You can’t perform that action at this time.
0 commit comments