We're updating the issue view to help you get more done. 

RFE:Register Formats (for BigDecimals, etc)

Description

There have been a few items sitting
around for a while: BigDecimal support, hex support, ... and also
custom message formats. We should be able to take care of at least some
of them with an extension to the new registration service.

For the first couple, what we need is for people to be able to
register a DigitList handler: something that will take a binary, and
convert to a string of digits + decimal position, and back. We can
make that slightly broader so as to handle hex. Then even if we don't
supply a BigDecimal in C, it would be easy to support it
internationally. We just need to broaden out DigitList to handle
arbitrary digit lengths.

For message formats, we allow someone to register <type, tag, handler>
The handler is a Format (instance, class or factory, as with the
current registration), which will converts text to or from a binary
(optionally using a pattern and/or locale).

For example, the current behavior for numbers would be equivalent to
registering:

<"double", "number", NumberFormat>

To get some new behavior, one could register

<"UnicodeSet", "uset", UnicodeSetFormat> // where one has written the
UnicodeSetFormat

then handle messages like:

MessageFormat::format(
"At {1,time} on {1,date}, the input contained {0,uset}.",
arguments, 3, result, success );

Environment

Status

Assignee

Douglas Felt

Reporter

TracBot

Labels

Time Needed

Days

tracCreated

Sep 03, 2002, 6:30 AM

tracOwner

doug

tracProject

ICU4C,ICU4J and ICU4JNI

tracReporter

mark.davis@a95c9666650cfc8d

tracStatus

accepted

tracWeeks

0.5

Components

Priority

minor