How do I write (serialize) a float to JSON with fixed 2 decimals using System.Text.Json?
Like {"Amount": 12.30}.
Not like {"Amount": 12.3} or {"Amount": 12.3001} or {"Amount": "12.30"}.
It seems there is no decimal precision option for float (or decimal or double or whatever), in JsonWriterOptions or either in JsonSerializerOptions. Also writing own converter seems to be unclear: Utf8JsonWriter writer WriteWhat?
Ok found it, raw converter seems to work: