SQR Edit mask

Numeric format masks
The numeric format masks use a number of characters that create special editing effects
to the output:
• 8 digit, zero fill to the right of the decimal point, trim leading blanks (left justify
the number)
• 9 digit, zero fill to the right of the decimal point, space fill to the left
Let #Unit_Price = 10.459
Let #Quantity = 10
Let #Total = 104.59
Let #Credit_Balance = -50.00
Print #Unit_Price (1,1) edit 9999.99
Print #Quantity (1,+3) edit 9999.99
Print #Total (1,+3) edit 9999.99
Print #Credit_Balance (1,+3) edit 9999.99
! The output will be: 10.46 10.00 104.59 -50.00
! Please note that SQR performed decimal rounding for #Unit_Price
• 0 digit, zero fill to the left
• B treated as a “9” but if a value is zero the output is printed blank
• $ dollar sign, optionally floats to the right
Let #Unit_Price = 10.459
Let #Quantity = 10
Let #Total = 104.59
Let #Credit_Balance = -50.00
Print #Unit_Price (1,1) edit $$$$.99
Print #Quantity (1,+3) edit 9999
Print #Total (1,+3) edit $$$$.99
Print#Credit_Balance (1,+3) edit $$$$.99
! The output will be: $10.46 10 $104.59 $-50.00
• V implied decimal point
Let #Total = 12104.59
Print #Total (1,1) edit $,$$$,$$$V99
! The output will be: $12,10459
• MI if placed at the end of the mask, causes a minus to be displayed at the right of
a negative number
• PR if placed at the end of the mask, causes angle brackets (< >) to be displayed
around a negative number
• PS if placed at the end of the mask, causes parentheses to be displayed around a
negative number
• NA if placed at the end of the mask, causes “N/A” to be displayed if the numeric
column variable is NULL
• NU if placed at the end of the mask, causes blanks to be displayed if the numeric
column variable is NULL
• E denotes scientific format. The number of 9s after the decimal point determines
the number of significant digits displayed
• .(dot) denotes decimal point
• ,(comma) denotes comma.
Date and time format masks
Date format masks are used not only for printing, but also in the date manipulation
built-in functions. As with the text or numeric masks, the date format masks use different
characters to control the display of date format fields:
• YYYY 4-digit year; YYY, 3-digit year (the current millennium is assumed);
YY, 2-digit year (the current century is assumed); Y, 1-digit year (the current century
and decade are assumed)
• RR 2-digit year, the century is calculated as follows:
– if RR is between 00 and 49 and the 2-digit current year is between 00 and 49, the
current century is assumed
– if RR is between 50 and 99 and the 2-digit current year is between 50 and 99, the
current century is assumed
– if RR is between 00 and 49 and the 2-digit current year is between 50 and 99, the
next century is assumed
– if RR is between 50 and 99 and the 2-digit current year is between 00 and 49, the
century before the current one is assumed
• Q quarter of year (1–4)
• WW week of year (1–53). W week of month (1–5)
• DDD day of year (1–366). DD day of month (1–31). D day of week (1–7)
starting from Sunday. DAY name of day. DY abbreviated name of day
• MONTH full name of month. MON abbreviated name of month. MM 2-digit
month (1–12)
• RM Roman numeral month (I–XII)
• CC century
• BC or AD BC / AD indicator
• HH, MI, SS hour (based on 24 hour clock), minute (0–59), second (0–59).
• NNNNNN fractions of second (the precision depends on the computer, operating
system, and database used)
• AM or PM meridian indicator
• | used to concatenate different masks
Any other characters in a date mask are treated as parts of a constant and will be
included in the output field as text. If you would like to include in this text some characters
that are special date mask characters from the previous list, you have to precede the
entire text with a backslash (\).
The masks DAY, MONTH, MON, AM, PM, BC, and AD are case-sensitive and follow
the case of the mask entered. For example, if the month is January, the mask MON
results in JAN, the mask Mon results in Jan.
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值