numberFormat

指定 IPropertyDescription::FormatForDisplay 如何將屬性的值格式化為字串。 只有在 displayInfo displayType=「Number」 > 時才 < 適用。 每個displayInfo元素應該只有一個numberFormat元素。

如果有多個元素,則會使用最後一個專案。 如果未提供 numberFormat 元素,則會將預設屬性設定套用至屬性描述。

Syntax

      <!-- numberFormat -->
      <xs:element name="numberFormat"  minOccurs="0" maxOccurs="1">
        <xs:complexType>
          <xs:attribute name="formatAs">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="General"/>
                <xs:enumeration value="Percentage"/>
                <xs:enumeration value="ByteSize"/>
                <xs:enumeration value="KBSize"/>
                <xs:enumeration value="SampleSize"/>
                <xs:enumeration value="Bitrate"/>
                <xs:enumeration value="SampleRate"/>
                <xs:enumeration value="FrameRate"/>
                <xs:enumeration value="Pixels"/>
                <xs:enumeration value="DPI"/>
                <xs:enumeration value="Duration"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="formatDurationAs">
              <xs:restriction base="xs:string">
                <xs:enumeration value="hh:mm"/>
                <xs:enumeration value="hh:mm:ss"/>
                <xs:enumeration value="hh:mm:ss.fff"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>

項目資訊

Parent 項目 子元素
displayInfo

 

屬性

屬性 Description
formatAs 公用。 選擇性。 預設值為 「General」。 指定顯示格式。 以下是有效的值。
意義
一般 預設值。 將值顯示為未格式化的數位。
百分比 將值格式化為百分比。 需要屬性為 UInt32。
ByteSize 視需要將值格式化為位元組、「KB」、「MB」 或 「GB」。 需要屬性為 UInt64。
KBSize 將值格式化為 「KB」,不論值為何。 需要屬性為 UInt64。
SampleSize 將值格式化為一些位。 需要屬性為 UInt32。
位元速率 將值格式化為 「Kbps」。 需要屬性為 UInt32。 此值必須以「每秒位數」單位儲存。
SampleRate 格式化 「KHz」 中的值。 需要屬性為 UInt32。 此值必須儲存在 「Hertz」 單位中。
FrameRate 格式化畫面格/秒中的值。 需要屬性為 UInt32。 此值必須儲存在「kb-frames-per-second」單位中。
阻擋的 以圖元單位格式化值。 需要屬性為 UInt32。
DPI 將值格式化為每英吋的點數。 需要屬性為 UInt32。
持續時間 將值格式化為持續時間。 使用 < formatDurationAs > 來指定持續時間格式。 需要屬性為 UInt64。

 

formatDurationAs 公用。 選擇性。 預設值為 「hh:mm:ss」。 只有在 formatAs=「Duration」時才適用。 需要屬性為 UInt64。 以下是有效的值。
意義
hh:mm 將值格式化為小時和分鐘。
hh:mm:ss 預設值。 將值格式化為小時、分鐘和秒。
hh:mm:ss.fff 將值格式化為小時、分鐘、秒和毫秒。