swat.SASFormatter.format

SASFormatter.format(self, value, sasfmt=None, width=12)

Format the given value

Parameters
valueany

The value to format.

sasfmtstring, optional

The SAS format to use.

widthint, optional

The width of the field to format to.

Returns
string

Formatted form of input value.

Examples

>>> fmt = SASFormatter()
>>> fmt.format(123.45678, 'F8.2')
123.45
>>> fmt.format(123.45678, 'DATE.')
'03-MAY-1960'