Fractional second formatting #187

Closed
dchiba opened this Issue Dec 20, 2012 · 6 comments

Projects

None yet

3 participants

@dchiba

This is to track the need to define the syntax to format fractional seconds using pattern letters.

An example of the approach proposed from the CLDR development list is:

HH:mm:ss.SSS###

Above pattern indicates minimum 3 /up to 6 decimal digits. Advantages of this syntax include might be easier to understand(resembles number format syntax) and a little bit more flexible (can set maximum digits, not only for 9).

We are looking to see if CLDR can add '#' for no-padding digits that may be present, in contrast to 'S', which always prints the specified number of digits by either truncating extra digits or padding zeroes.

We also need to determine how to localize the decimal point. Predefined patterns for locales are generally not available. JSR-310 would like CLDR to do either or both of:

  • Define patterns with fractional seconds with the decimal point localized to the locale
  • Define a pattern letter to print the locale specific punctuation for the decimal point

Currently, CLDR says "Certain ASCII punctuation characters may become variable in the future (for example, ":" being interpreted as the time separator and '/' as a date separator, and replaced by respective locale-sensitive characters in display)." For the second bullet, a dot '.' could work just like the way it works in number formatting.

JSR-310 can then consider predefined formatter(s) in DateTimeFormatters and the syntax support based on the CLDR defined patterns and syntax.

@jodastephen
ThreeTen member

I'm happy to use # fr fractional seconds. I'm unconvinced that it should be used for non-fractional output.

@jodastephen
ThreeTen member

This should probably be in M7 if it is happening, but won't be.

@RogerRiggs

add '#' to the list of reserved characters.

@RogerRiggs

CLDR Ticket 5556 for Optional digits in fractional seconds pattern; http://unicode.org/cldr/trac/ticket/5556

Reserved the "#' character, otherwise, this is an RFE waiting for some action from CLDR.

@RogerRiggs

Related JBS/bugs.sun.com 8015990

@RogerRiggs RogerRiggs closed this Sep 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment