Deployment Guide

378 | Reference DellNetworking W- ClearPassGuest 6.1 | Deployment Guide
Function Description
NwaBoolFormat
Formats a Boolean value as a string.
l If the argument is 0 or 1, a 0 or 1 is returned for false and true, respectively.
l If the argument is a string containing a “|” character, the string is split at the | separator and
used for false and true values.
l If the argument is an array, the 0 and 1 index values are used for false and true values.
Otherwise, the string values “false” and “true” are returned.
NwaByteFormat
Formats a non-negative size in bytes as a human readable number (bytes, KB, MB, GB, etc). 1 KB is
defined as 1,024 bytes, 1 MB as 1,024 KB (1,048,576 bytes), and 1 GB as 1,024 MB (1,073,741,824
bytes).
l If a negative value is supplied, returns the argument (or null if no argument was supplied).
l If a non-numeric value is supplied, that value is returned directly.
NwaCurrencyFormat
Formats a numeric value that indicates a monetary amount as a string.
If the argument is null or not supplied, the current locale’s settings are used to format the monetary
value.
l The argument may be an array, which will override the current locale’s settings (see
NwaNumberFormat for the list of settings that are used).
l The argument may be a numeric value, which is used as the number of fractional digits to use
when formatting the monetary amount (other locale settings will remain unchanged in this
case).
NwaDateFormat
Format a date like the PHP function strftime(), using the argument as the date format string. Returns
a result guaranteed to be in UTF-8 and correct for the current page language. See "Date/Time
Format Syntax" on page 353 for a list of available date/time formats, or use one of the following
special format strings:
l hhmmss, hh:mm:ss time of day
l iso8601, iso8601t, iso-8601, iso-8601t various ISO 8601 date formats with and without hyphen
separators and the time of day
l longdate date and time in long form
l displaytime time of day
l ?: returns the string following the ?: if the time value is 0, or uses the format string before the
?: otherwise
l recent for example, “2 minutes ago”, “3 months ago”
NwaDurationFormat
Converts a time measurement into a description of the corresponding duration.
l Format parameters: seconds, minutes, hours, days, weeks.
l Any format can be converted to another.
l By default, this function converts an elapsed time value specified in seconds to a value that is
displayed in weeks, days, hours, minutes and seconds.
Up to four additional arguments may be supplied to control the conversion:
l in_format The current units of the value being converted (seconds, minutes, hours, days,
weeks)
l max_format Controls the max increment you want displayed.
l min_format Controls the min increment you want displayed. Only whole numbers are printed.
l default If set, this value will be returned when the resulting duration (after min_format is
taken into account) is 0.
NwaExplodeComma
Converts a string to an array by splitting the string at each comma and forming an array of all the
substrings created in this way.
Table 46:
Form Field Display Functions