Duration Json Formatter
Encode a duration as a JSON string like "1.200s". From the spec:
Generated output always contains 0, 3, 6, or 9 fractional digits, depending on required precision, followed by the suffix "s". Accepted are any fractional digits (also none) as long as they fit into nano-seconds precision and the suffix "s" is required.
Note that Duration always returns a positive nanosPart, so "-1.200s" is represented as -2 seconds and 800_000_000 nanoseconds.