{"record":{"id":"62a1cf0b7de5f12d","repo":"Humanizr/Humanizer","slug":"the-configured-iformatter-for-culture-name-c","errorCode":null,"errorMessage":"The configured IFormatter for '{culture?.Name ?? CultureInfo.CurrentCulture.Name}' does not support fractional seconds. Implement IFractionalTimeSpanFormatter.","messagePattern":"The configured IFormatter for '(.+?)' does not support fractional seconds\\. Implement IFractionalTimeSpanFormatter\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer/TimeSpanHumanizeExtensions.cs","lineNumber":440,"sourceCode":"                    formatter,\n                    TimeUnit.Second,\n                    SaturateToInt(part.Value),\n                    culture,\n                    false,\n                    toSymbols,\n                    null));\n                continue;\n            }\n\n            if (formatter.GetType() == typeof(DefaultFormatter))\n            {\n                formattedParts.Add(((DefaultFormatter)formatter).TimeSpanHumanizeWithFractionalSeconds(part.Value, toSymbols));\n                continue;\n            }\n\n            if (formatter is not IFractionalTimeSpanFormatter fractionalFormatter)\n            {\n                throw new InvalidOperationException(\n                    $\"The configured {nameof(IFormatter)} for '{culture?.Name ?? CultureInfo.CurrentCulture.Name}' \" +\n                    $\"does not support fractional seconds. Implement {nameof(IFractionalTimeSpanFormatter)}.\");\n            }\n\n            formattedParts.Add(fractionalFormatter.TimeSpanHumanizeWithFractionalSeconds(part.Value, toSymbols));\n        }\n\n        return ConcatenateTimeSpanParts(formattedParts, culture, collectionSeparator);\n    }\n\n    static bool IsBuiltInFractionalTimeSpanFormatter(IFormatter formatter) =>\n        formatter.GetType() == typeof(DefaultFormatter) || formatter is ProfiledFormatter;\n    static List<FractionalSecondPart> CreateFractionalSecondParts(\n        RoundedTimeSpan roundedTimeSpan,\n        int precision,\n        bool countEmptyUnits,\n        TimeUnit maxUnit)\n    {","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer/TimeSpanHumanizeExtensions.cs#L422-L458","documentation":"Thrown when formatting a fractional-seconds time part and the culture's IFormatter is neither DefaultFormatter (or ProfiledFormatter) nor an IFractionalTimeSpanFormatter. This means the locale's formatter was not updated to support fractional second output. The culture name is included in the message to identify which locale is affected.","triggerScenarios":"Calling HumanizeWithFractionalSeconds with a culture whose registered formatter doesn't implement IFractionalTimeSpanFormatter, and the TimeSpan has a visible fractional seconds component. Common with custom or incomplete locale formatters.","commonSituations":"Using a custom IFormatter registered for a specific locale that lacks fractional-seconds support. A locale profile that was authored before fractional seconds were introduced. Mixing a built-in strategy with a third-party formatter.","solutions":["Implement IFractionalTimeSpanFormatter on your custom formatter class.","Use a built-in DefaultFormatter or ProfiledFormatter for the affected culture.","Avoid fractional-seconds humanize for cultures whose formatter doesn't support it."],"exampleFix":"// before\npublic class MyFormatter : IFormatter { /* no fractional support */ }\n\n// after\npublic class MyFormatter : IFormatter, IFractionalTimeSpanFormatter\n{\n    public string TimeSpanHumanizeWithFractionalSeconds(decimal seconds, bool toSymbols) => ...\n}","handlingStrategy":"type-guard","validationCode":"static bool FormatterSupportsFractional(IFormatter formatter, CultureInfo? culture) =>\n    formatter is IFractionalTimeSpanFormatter ||\n    formatter.GetType() == typeof(DefaultFormatter) ||\n    formatter is ProfiledFormatter;","typeGuard":"static bool CanFormatFractional(IFormatter formatter) =>\n    formatter is IFractionalTimeSpanFormatter ||\n    formatter is ProfiledFormatter;","tryCatchPattern":null,"preventionTips":["Implement IFractionalTimeSpanFormatter on custom locale formatters.","Check formatter type before requesting fractional output for exotic locales.","Use built-in formatters for fractional-seconds support."],"tags":["timespan","fractional-seconds","formatter","locale","invalid-operation"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}