# Format spec errors: ValueError: Unknown format code 'd' for object of type 'str' (also 'float') (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/format-spec-errors-valueerror-unknown-format-code-d-for-object-of-type-str-also-float-python-3-12-10-d427b7888277
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, format, valueerror

f"{'a':d}" and f'{1.5:d}'. format(1,'z') -> 'Negative zero coercion (z) not allowed in integer format specifier'.
