Variable formatting options in Uluro
String
[CASE MODIFIER]%[JUSTIFICATION][PADDING][.MAXIMUM WIDTH][s,w,W]
'%%' = literal '%'
[CASE MODIFIER]
'#M' = mixed case
'#U' = upper case
'#L' = lower case
(NOTE: mappings with a case modifier must not have a label)
[JUSTIFICATION]
' ' (blank) = right-justify
'-' = left-justify
[PADDING]
The maximum number of spaces to pad the variable with.
[MAXIMUM WIDTH]
The maximum width of a variable. Variables longer than the maximum width will be truncated.
[s,w,W]
's' = regular string
'w' = spelled out numeric value
'W' = spelled out currency value
(NOTE: 'W' and 'w' formats are only available in the Format and Assign Field commands)
Examples:
%s, foo = "foo"
%6s, foo = " foo"
%-6s, foo = "foo "
%2s, foo = "foo"
%.2s, foo = "fo"
%6.2s, foo = " fo"
%-6.2s, foo = "fo "
%w, 12.44 = twelve decimal forty four
%w, -12.44 = negative twelve decimal forty four
%W, 12.44 = twelve dollars and forty four cents
%W, -12.44 = minus twelve dollars and forty four cents
#L%s, fOO bAr = "foo bar"
#M%s, fOO bAr = "Foo Bar"
#U%s, fOO bAr = "FOO BAR"
Integer
%[JUSTIFICATION][PADDING][.ZERO PADDING][d,u,x]
'%%' = literal '%'
[JUSTIFICATION]
' ' (blank) = right-justify
'-' = left-justify
[PADDING]
The maximum number of spaces to pad the variable with.
[ZERO PADDING]
The maximum number of zeros to pad the left side of the variable with.
[d,u,x]
'd' = regular signed integer
'u' = unsigned integer (32 bit 2's complement)
'x' = hexadecimal
Examples:
%d, 1234 = 1234
%6d, 123 = " 123"
%-6d, 123 = "123 "
%2d, 123 = 123
%.6d, 123 = 000123
%6.4d, 123 = " 0123"
%-6.4d, 123 = "0123 "
%x, 123 = 7F
%d, -123 = -123
%x, -123 = FFFFFF85
%u, -123 = 4294967173
Floating Point / Real / Currency
%[JUSTIFICATION][PADDING][.PRECISION][e,f,g,m,n]
'%%' = literal '%'
[JUSTIFICATION]
' ' (blank) = right-justify
'-' = left-justify
[PADDING]
The maximum number of spaces to pad the variable with.
[PRECISION]
The maximum number of decimal places to show.
[e,f,m,n]
'e' = scientific notation; defaults to 15 decimal places
'f' = regular floating point number; defaults to 2 decimal places
'm' = dollar format with dollar sign, thousand's separators and parenthesis for negative numbers; defaults to 2 decimal places.
'n' = number format with thousand's separators; defaults to 2 decimal places
Examples:
%f, 1234.5678 = 1234.57
%f, -1234.5678 = -1234.57
%.5f, 1234.5678 = 1234.56780
%.1f, 1234.5678 = 1234.6
%e, 1234.5678 = 1.23456780000000E+003
%e, -1234.5678 = -1.23456780000000E+003
%m, 1234.5678 = $1,234.57
%m, -1234.5678 = ($1,234.57)
%n, 1234.5678 = 1,234.57
%n, -1234.5678 = -1,234.57
Date
'd' = displays the day number without a leading zero (1 - 31)
'dd' = displays the day number with a leading zero (01 - 31)
'ddd' = displays the three letter day abbreviation (Sun - Sat)
'dddd' = displays the full day name (Sunday - Saturday)
'ddddd' = displays the 'Short Date' (m/d/yyyy)
'dddddd' = displays the 'Long Date' (dddd, mmmm dd, yyyy)
'm' = displays the month number without a leading zero (1 - 12)
'mm' = displays the month number with a leading zero (01 - 12)
'mmm' = displays the three letter month abbreviation (Jan - Dec)
'mmmm' = displays the full month name (January - December)
'yy' = displays the 2 digit year
'yyyy' = displays the full, 4 digit year
"QUOTED TEXT" = displays the quoted text as-is
Examples:
d, 2/7/11 = 7
dd, 2/7/11 = 07
ddd, 2/7/11 = Mon
dddd, 2/7/11 = Monday
ddddd, 2/7/11 = 2/7/2011
dddddd, 2/7/11 = Monday, February 02, 2011
m, 2/7/11 = 2
mm, 2/7/11 = 02
mmm, 2/7/11 = Feb
mmmm, 2/7/11 = February
yy, 2/7/11 = 11
yyyy, 2/7/11 = 2011
"MONTH:" mm, "DAY:" dddd = MONTH: 02, DAY: Monday
Time
'ampm' = inserts an 'AM/PM' symbol and converts the nearest preceding hour into 12 hour format
'h' = displays the hour without a leading zero (1 -12)
'hh' = displays the hour with a leading zero (01 -12)
'n' = displays the minutes without a leading zero (0 -59)
'nn' = displays the minutes with a leading zero (00 - 59)
's' = displays the seconds without a leading zero (0 - 59)
'ss' = displays the seconds with a leading zero (00 -59)
't' = displays the 'Short Time' (h:nn ampm)
'tt' = displays the 'Long Time' (h:nn:ss ampm)
"QUOTED TEXT" = displays the quoted text as-is
Examples:
h ampm, 2:03 = 2 AM
14:03 = 2 PM
h, 2:03:09 = 2
hh, 2:03:09 = 02
n, 2:03:09 = 3
nn, 2:03:09 = 03
s, 2:03:09 = 9
ss, 2:03:09 = 09
t, 2:03:09 = 2:03 AM
14:03:09 = 2:03 PM
tt, 2:03:09 = 2:03:09 AM
14:03:09 = 2:03:09 PM
"HOUR:" hh, "MINUTE:" nn = HOUR: 02, MINUTE: 03
0 Comments