File format.icn

Summary


 $Id: format.icn,v 1.2 2006-07-10 13:43:32 rparlett Exp $

 This file is in the public domain.

 Author: Robert Parlett (parlett@dial.pipex.com)

Procedures:
format_escape, format_int_to_string, format_int_to_words, format_norm, format_numeric_to_string, format_string_to_int, format_unescape

This file is part of the util package.

Source code.

Details
Procedures:

format_escape(subject)


 Add escape sequences to the subject.


format_int_to_string(subject, base, p)


 Convert an integer to a string.

 @param base   The desired base of the result.
 @param p      The minimum width of the result, padding with zeroes
 @             if necessary.


format_int_to_words(subject)


 Convert the subject integer into words, eg 231 to "Two Hundred and Thirty-One"


format_norm(n)


format_numeric_to_string(subject, p, f)


 Convert a numeric to a string.

 @param p  The number of decimal places to produce (default 4).
 @param f  A cset of flags.  If c contains {'e'} then the output is
 @         in scientific notation.  If c contains {','} then commas
 @         are introduced into the non-fractional part of the number;
 @         if c contains {'+'} then a leading + is added to positive
 @         numbers.
 @


format_string_to_int(subject, base)


 Convert a string to an integer.
 @param base  The base to use for the conversion (default is 16).


format_unescape(subject)


 Remove escape sequences from the subject.



This page produced by UniDoc on 2021/04/15 @ 23:59:54.