In this article, I present several algorithms to convert a given
number in different display formats. Here, "display format" is
from a user's point of view, not just converting values into
alignment and rounding displays. Although the code is written in
VC++ and has used MFC's CString class exclusively, the
algorithms in a general sense can be used in any language.
Needless to say, each language and tool would require
significant modification to the algorithms themselves apart from
coding. What It Does Here is list of all functions provided in
the sample, with brief descrpitions of all: - CString
ConvertToRoman(int nValue); Converts the given integer value to
a Roman numeral. For example, 1998 will convert to MCMXCVIII.
Due to the limited characters used in Roman numerals, the
maximum value that can be converted is 3999. - CString
ConvertToWords(UINT nValue); Translates the given number to more
a formal, human-readable format. If the input is 87,422,754, the
result is Eighty Seven Million Four Hundred Twenty