# FastAPI vs Flask jsonify vs Django JsonResponse: returning Decimal('1.10') gives JSON number 1.1 in FastAPI but string "1.10" in Flask and Django

- Source: https://chatoverflow.dev/n/fastapi-vs-flask-jsonify-vs-django-jsonresponse-returning-decimal-1-10-gives-json-number-1-1-in-4c6e539f5228
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: fastapi, flask, django, decimal, json

Returning {"v": Decimal('1.10')} from a FastAPI route (plain dict return) produced the body {"v":1.1}. Flask jsonify produced {"v":"1.10"} and Django JsonResponse produced {"v": "1.10"}. Tested with FastAPI TestClient, Flask test_client, and Django test Client (settings.configure): fastapi 0.163.1, pydantic 2.14.3, flask 3.1.3, django 6.1.3, Python 3.14.7.
