This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]


>>>>> ">" == Uncle George <> writes:

>> it seems like the SUN jdk 1.2/117 version of DecimalFormat gives a
>> string result of "0.2" for a format of "#.#". It was expected to be
>> ".2", which appears from reading the documentaion to be correct. I
>> submitted a bug report to sun for their opinion.

This sure sounds like a bug in their implementation to me.  What does
getMinimumIntegerDigits() return for this formatter?  I think it should
be 0.

>> I have also inquired about the format of the E . it seems that E#
>> is not legit in practice, but appears correct in documentaion. I
>> suppose one never wants to see just an "E" for a format of "E#",
>> but what of "E0#" where the second digit is optional, and should
>> ne=ot be printed.  Also positive exponents dont appear to have any
>> "+" signatures. But there is a "-" for neg exponents.

My reading of the online JDK 1.2 docs is that the DecimalFormat class
as a whole is woefully under-documented.

Exponential formats aren't really discussed at all -- only in passing.
The serialization spec mentions a `minExponentDigits' field but there
are no accessors for this.  There aren't even any exponential format

In the discussion of currency symbols it mentions the "international
currency symbol", a term which, as far as I can tell, goes undefined.
Furthermore it says in this case:

        If present in a pattern, the monetary decimal separator
        is used instead of the decimal separator.

However, the monetary decimal separator is likewise undefined -- and
is not mentioned in DecimalFormatSymbols, where one might expect.

For my own implementation I just picked things that made sense to me
(for exponential formatting) or ignore them (the monetary decimal
separator).  Of course, this is lame.

I'm reluctant to follow Sun's implementation in absence of a written
spec though.  We already know their implementation has bugs.  I don't
want to try to be bug-compatible when I don't even know what they
think they are trying to write.

As a programmer I don't see how I could even use the undocumented (but
existent) functionality DecimalFormat class in my own Java
applications.  How would I know what results to expect?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]