Skip to content

mdlTextConversion

mdlTextConversion is a public module providing numeric-to-English-words conversion (typically for printed check/dollar amounts) and a sentence-case string extension.

Purpose

  • Convert a Long numeric value into its spelled-out English-words representation.
  • Provide a ToSentenceCase extension method for sentence-style string capitalization.

Context

  • Namespace: SAIF.Business.Utilities
  • Assembly/package: SAIF.Business.Utilities (NuGet package SAIF.BOF.Business.Utilities)

Public members

Member Signature Purpose
NumberToText Public Function NumberToText(n As Long) As String Recursively converts a Long numeric value into its English words representation (e.g., spelled-out check/dollar amounts). Supports values up to 999,999,999,999,999; throws ApplicationException above that limit. See BR-002.
ToSentenceCase <Extension()> Public Function ToSentenceCase(Target As String) As String Upper-cases the first character of a string and lower-cases the remainder.

Behavioral notes

  • NumberToText enforces an explicit upper bound of 999,999,999,999,999; calling it with a larger value throws ApplicationException("Number too large to convert to text. Limit is 999,999,999,999,999."). See BR-002.
  • NumberToText decomposes the input recursively by magnitude group (ones/teens, tens, hundreds, thousands, millions, billions, trillions), using the private RoundDown helper internally.
  • ToSentenceCase only affects the first character's case; it does not perform per-word title-casing like TitleCase.ToTitleCase.

Constraints and usage notes

  • NumberToText is intended for positive integer amounts (e.g., dollar amounts on printed checks); behavior for negative values could not be confirmed from the scanned source.**

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Business\SAIF.Business.Utilities\mdlTextConversion.vb