{"record":{"id":"ec5b8c32a314dd9a","repo":"Humanizr/Humanizer","slug":"indian-scale-form-number-profiles-require-positive","errorCode":null,"errorMessage":"Indian scale-form number profiles require positive scale values.","messagePattern":"Indian scale-form number profiles require positive scale values\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer/Localisation/NumberToWords/IndianScaleFormNumberToWordsConverter.cs","lineNumber":160,"sourceCode":"        {\n            throw new InvalidOperationException(\"Indian scale-form number profiles require dense words for 0 through 99.\");\n        }\n\n        return value;\n    }\n\n    static IndianScaleForm[] ValidateScales(IndianScaleForm[] value, int denseUnitCount)\n    {\n        if (value.Length == 0 || value[^1].Value > denseUnitCount)\n        {\n            throw new InvalidOperationException(\"Indian scale-form number profiles require a scale value covered by the dense unit map range.\");\n        }\n\n        for (var i = 0; i < value.Length; i++)\n        {\n            if (value[i].Value <= 0)\n            {\n                throw new InvalidOperationException(\"Indian scale-form number profiles require positive scale values.\");\n            }\n\n            if (i > 0 && value[i - 1].Value <= value[i].Value)\n            {\n                throw new InvalidOperationException(\"Indian scale-form number profiles require scales in descending order.\");\n            }\n        }\n\n        return value;\n    }\n}\n\n/// <summary>\n/// Describes one scale row with exact and continuing forms.\n/// </summary>\n/// <param name=\"Value\">The numeric scale value.</param>\n/// <param name=\"Singular\">The singular scale form used when the phrase ends at this scale.</param>\n/// <param name=\"SingularWithRemainder\">The singular scale form used before a remainder.</param>","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer/Localisation/NumberToWords/IndianScaleFormNumberToWordsConverter.cs#L142-L178","documentation":"Profile constructor validation: every scale row's Value must be strictly positive (> 0). A non-positive scale value is rejected at instantiation.","triggerScenarios":"First converter use for an IndianScaleForm culture whose scale data includes a Value <= 0.","commonSituations":"Locale YAML typo entering 0 or a negative scale value.","solutions":["Report the locale bug — a scale value is non-positive.","Use a locale with correct scale values.","If authoring, fix the offending scale Value to a positive integer."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Construction-time validation; no public pre-check. Isolate converter resolution per culture.","typeGuard":null,"tryCatchPattern":"string words;\ntry\n{\n    words = value.ToWords(culture);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"positive scale values\"))\n{\n    words = value.ToWords(CultureInfo.InvariantCulture);\n}","preventionTips":["Smoke-test converter resolution per locale at startup.","Report non-positive scale values upstream.","Pin consistent Humanizer versions."],"tags":["number-to-words","profile-data","localization","construction-validation"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}