Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

numconv(1) [debian man page]

NUMCONV(1)							   User Commands							NUMCONV(1)

NAME
numconv - convert numbers from one number system to another SYNOPSIS
Numconv <options> DESCRIPTION
numconv is a filter that converts integers from one number system to another. For example, it can convert from Roman Numerals such as "CCLVI" to ordinary Western numbers such as "256" or from Western numbers to Chinese. The great majority of number systems, both modern and ancient, are supported, including numerous variants. If the input number system is 'all', the number system will be autodetected. numconv is a command line interface to libuninum a library for converting between textual representations of numbers and machine-internal representations. Further information about the conversions performed is available in the documentation for this library. OPTIONS
-i <input file> Read input from the specified file. -o <output file> Write output into the specified file. -I Identify the number system of the input. -c List the available number system cover terms. -l List the available number systems. -f <input number system> Specify the number system of the input. -t <output number system> Specify the number system of the output. -b <input base> Specify the input base for Western numbers. The base must be in the range [1,36]. -B <output base> Specify the output base for Western numbers. The base must be in the range [1,36]. -g <output general group size> Specify the size of digit groups other than the ow-order group. The default is 3. -G <output low group size> Specify the size of the low-order group of digits. The default is 3. -s <output group separator character> Specify character to use as "thousands separator". The default is a comma. -L Set the output grouping parameters, general group size, first group size, and group separator character, according to the current locale. -m When generating Roman numerals, use unit characters with superscript macron for thousands greater than one instead of Ms. -h Print help information. -v Print version information. EXAMPLES
To convert from Roman Numerals to ordinary Western numbers: numconv -f Roman -t Western_Lower To convert from ordinary Western numbers to the variety of number in current use in the People's Republic of China: numconv -f Western -t Mandarin_Regular_Simplified To convert from ordinary Western numbers to Western numbers in base 2: numconv -f Western_Lower -t Western_Lower -B 2 To convert from Urdu numbers to Hindi numbers with the traditional Indian grouping: numconv -f Perso_Arabic -t Devanagari -g 2 SEE ALSO
libuninum (3) AUTHOR
Bill Poser (billposer@alum.mit.edu) LICENSE
GNU General Public License, version 2. (http://www.gnu.org/licenses/gpl.txt) numconv September 2007 NUMCONV(1)

Check Out this Related Man Page

ascii2binary(1) 					      General Commands Manual						   ascii2binary(1)

NAME
ascii2binary - Convert ASCII numbers to binary SYNOPSIS
ascii2binary [flags] DESCRIPTION
ascii2binary reads input consisting of a sequence of ASCII textual representations of numbers, separated by whitespace, and produces as output the binary equivalents. The type (unsigned integer, signed integer, or floating point number) and size of the binary output is selected by means of command line flags. The default is unsigned character. Input is checked both for format errors and to ensure that the number requested can be represented in a number of the requested binary type and size. INPUT FORMAT
The input formats supported are exactly those supported by strtod(3) for floating point numbers, by strtoll(3) for signed integers, and by strtoull(3) for unsigned integers, except that, unlike strtod(3) floating point numbers may have thousands separators. This means that by default integers may be decimal, octal, or hexadecimal, determined by the usual conventions. The command line flag -b may be used to spec- ify another base for integer conversions. COMMAND LINE FLAGS
Long options may not be available on some systems. -b,--base <base> set base in range [2,36] for integer conversions. The base may be either an integer or: (b)binary (o)octal (d)ecimal (h)exadecimal. -h,--help print help message -L,locale <locale> Set the LC_NUMERIC facet of the locale to <locale>. -s,--sizes print sizes of types on current machine and related information -t,--type <type> set type and size of output The following are the possible output types. Note that some types may not be available on some machines. d double f float sc signed char ss signed short si signed int sl signed long sq signed long long uc unsigned char us unsigned short ui unsigned int ul unsigned long uq unsigned long long -v,--version identify version -X,--explain-exit-codes print a summary of the exit status codes. EXIT STATUS
The following values are returned on exit: 0 SUCCESS The input was successfully converted. 1 INFO The user requested information such as the version number or usage synopsis and this has been provided. 2 SYSTEM ERROR An error resulted from a failure of the operating system such as an i/o error or inability to allocate storage. 3 COMMAND LINE ERROR The program was called with invalid or inconsistent command line flags. 4 RANGE ERROR This means that the input may be well-formed but cannot be represented as the required type. For example, if the input is the string 983 and ascii2binary is requested to convert this into an unsigned byte, ascii2binary will exit with a RANGE ERROR because 983 exceeds the maximum value representable in an unsigned byte, which is 255. 5 INPUT ERROR This means that the input was ill-formed, that is that it could not be interpreted as a number of the required type. For example, if the input is 0x2A and a decimal value is called for, an INPUT ERROR will be returned since 0x2A is not a valid representation of a decimal integer. AUTHOR
Bill Poser (billposer@alum.mit.edu) LICENSE
GNU General Public License, version 3 SEE ALSO
binary2ascii(1), strtod(3), strtoll(3), strtoull(3) July, 2010 ascii2binary(1)
Man Page