format()

Synopsis

Returns a formatted string, using C-style formatted specifications. It supports integer and floating point formats, including format types: d, i, o, u, x, X, e, E, f, g, G. The first argument, str, is a string containing a single C "%" format specification. For Integers, use "%xd", where x is any legal C integer format specifier (including none). For Numbers, use "%xf" where x is any legal C floating point format specifier. The second argument, value, is currently restricted to Integers or Numbers. Numbers are coerced into integer for integer formatting by taking the ceiling of the number. Use Format for formatting only a single number, then concatenate strings together using the '&' operation.

Syntax

format ( str As String, _
          As Value ) As String 
Argument Type Description
str String A "c" style format specification
value Any must be either an Integer or a Number

Example 1

Intent >format("%d", 3) 
--> "3" 

Example 2

Intent >format("%3.3f", 3) 
--> "3.000" 

Example 3

Intent >format("abcd  %8.4f", 6.45) 
--> "abcd  6.4500"