]> granicus.if.org Git - icu/commitdiff
ICU-9250 Document that date format S+ fields truncate for S,SS and zero-pad for SSSS+
authorPeter Edberg <pedberg@unicode.org>
Wed, 17 Oct 2012 04:41:19 +0000 (04:41 +0000)
committerPeter Edberg <pedberg@unicode.org>
Wed, 17 Oct 2012 04:41:19 +0000 (04:41 +0000)
X-SVN-Rev: 32646

icu4c/source/i18n/unicode/smpdtfmt.h
icu4c/source/i18n/unicode/udat.h

index 170dbebbc9afdf41bb0ca59a7b0aa872ac50042f..aec9c041fa6d31db2392548907cd295efc830a0e 100644 (file)
@@ -82,6 +82,7 @@ class TimeZoneFormat;
  * m        minute in hour          (Number)            30
  * s        second in minute        (Number)            55
  * S        fractional second       (Number)            978
+ *          (maximum resolution of SSS; truncated if shorter, zero-padded if longer)
  * E        day of week             (Text)              Tuesday
  * e        day of week (local 1~7) (Text & Number)     Tues & 2
  * D        day in year             (Number)            189
index 89a1106c321f8617f7884976f1fd8610b4f2ba99..ede0b1ece17d63e1da5996ef00975dcec7c5b39a 100644 (file)
@@ -534,6 +534,14 @@ typedef enum UDateFormatField {
     /**
      * FieldPosition and UFieldPosition selector for 'S' field alignment,
      * corresponding to the UCAL_MILLISECOND field.
+     *
+     * Note: Time formats that use 'S' can display a maximum of three
+     * significant digits for fractional seconds, corresponding to millisecond
+     * resolution and a fractional seconds sub-pattern of SSS. If the
+     * sub-pattern is S or SS, the fractional seconds value will be truncated
+     * (not rounded) to the number of display places specified. If the
+     * fractional seconds sub-pattern is longer than SSS, the additional
+     * display places will be filled with zeros.
      * @stable ICU 3.0
      */
     UDAT_FRACTIONAL_SECOND_FIELD = 8,