Similar posts such as the following do not answer my question. Convert a string to integer with decimal in Python
Consider the following Python code.
>>> import decimal
>>> s = '23.456'
>>> d = decimal.Decimal(s)
>>> d
Decimal('23.456') # How do I represent this as simply 23.456?
>>> d - 1
22 # How do I obtain the output to be 22.456?
How do I convert a string to a decimal number, so I am able to perform arithmetic functions on it and obtain an output with the correct precision?