Applies To: |
|
Summary: |
When showing milliseconds in the alarm display format, how can I display leading zeros? For example, with {millisec,3} 123 milliseconds shows as 123, but I would like 3ms to show as 003. |
Solution: |
Use the Z operator in formating to provide
a right justified zero filled field eg {millisec,3,z}. Another option is the LocalTimeDate field eg {LocalTimeDate,23}. This field generates a string in the fixed format "yyyy-mm-dd hh:mm:ss[.ttt]". There are other format modifiers. To set the justification of the text in each field, use a justification specifier. The justification specifier is optional - if it is omitted, the field is left justified. If you use a justification specifier, you must also use the width specifier. You can use one of four justification characters: L Left. Justifies the field to the left for the number of characters specified by the width specifier. R Right. Justifies the field to the right for the number of characters specified by the width specifier. N None. Left justified, displaying all the characters with no length restrictions. Z Zero fill, justify right. A zero is placed in any unused characters up to the set width of the field. For example, if you wanted to present millisecond values in a field, you could set the display format to {TimeMS, 3, Z}. This would result in a value of "7" being displayed as "007". |
Keywords: |
alarm display format, justification, leading zeroes |
Related Links
Attachments