共用方式為


numberFormat

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

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

語法

      <!-- 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 沒有

 

屬性

屬性 描述
formatAs 公共。 自選。 預設值為 「General」。 指定顯示格式。 以下是有效的值。
價值 意義
常規 違約。 將值顯示為未格式化的數位。
百分比 將值格式化為百分比。 屬性必須是UInt32。
ByteSize 視需要將值格式化為位元組、“KB”、“MB” 或 “GB”。 需要屬性為UInt64。
KBSize 無論值為何,將值格式化為 “KB”。 需要屬性為UInt64。
SampleSize 將值格式化為數位。 屬性必須是UInt32。
BitRate 格式化 “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 將值格式化為小時、分鐘、秒和毫秒。