tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

Decimal field represented in scientific notation when using pydantic_model_creator

Open Yalchin403 opened this issue 2 years ago • 2 comments

Describe the bug I use pydantic_model_creator for creating schema from model which I use for serialization in the response. I have a decimal field, which is shown in scientific notation in the response instead of being Decimal.

To Reproduce

  • Create a model containing a decimal field
  • Add a schema to with pydantic_model_creator
  • Add a view to create a record of this model and return this model using the schema you created
  • You will see the decimal field in scientific notation

Expected behavior I normally expect to get the defined value as it is, for example, if I created this record's decimal field as 200.00 i expect it as 200.00 not as 2E+2

Additional context Add any other context about the problem here.

image

Yalchin403 avatar Jan 23 '24 13:01 Yalchin403

i have the same problem...

sloppycoder avatar Jun 28 '24 07:06 sloppycoder