Numsense
A .NET library for parsing natural-language numerals ("forty-two") to integers, and converting the other way as well
Install / Use
/learn @ploeh/NumsenseREADME
Numsense
A .NET library for parsing natural-language numerals ("forty-two") to integers, and converting the other way as well. While written in F#, it can be used from both F# and C#:
F#:
> let englishNumeral = Numeral.toEnglish 42;;
val englishNumeral : string = "forty-two"
> let i = Numeral.tryParseEnglish "one-thousand-three-hundred-thirty-seven";;
val i : int option = Some 1337
C#:
var englishNumeral = Numeral.English.ToNumeral(42);
// englishNumeral is "forty-two"
int i;
var success = Numeral.English.TryParse(
"one-thousand-three-hundred-thirty-seven",
out i);
// success is true, and i is 1337
Languages
Other languages than English are supported as well:
> let danishNumeral = Numeral.toDanish 9;;
val danishNumeral : string = "ni"
If you don't see your favourite language, please consider submitting a pull request.
NuGet
Numsense is available via NuGet: Numsense.
Versioning
Numsense follows Semantic Versioning 2.0.0.
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
