[Mono-list] IntegerFormatter

Derek Holden dsh2120@draper.com
Tue, 27 Nov 2001 07:33:58 -0500


Hey Nick,

I think the error may be in the SByte test. Format type "n" is listed in the
EMCA IFormattable doc as:

n  Number Format: Used for strings in the following form:

[-]d,ddd,ddd.dd...d

The minus sign ("-") appears only if the number is negative. At least one
non-zero digit (d) precedes the decimal separator ("."). The precision
specifier determines the number of decimal places (dd.d). If the precision
specifier is omitted, NumberFormatInfo.NumberDecimalDigits determines the
number of decimal places in the string. Results are rounded to the nearest
representable value when necessary. The NumberGroupSizes,
NumberGroupSeparator, and NumberDecimalSeparator members of a
NumberFormatInfo supply the size and separator for digit groupings, and
decimal separator, respectively.

I know in currency format and percent format that parenthesis are used for
negative values, but that is determined by
NumberFormatInfo.CurrencyNegativePattern and
NumberFormatInfo.PercentNegativePattern, which are defined in the
NumberFormatInfo spec.


----- Original Message -----
From: "Nick Drochak" <ndrochak@gol.com>
To: <dholden@draper.com>
Cc: <mono-list@ximian.com>
Sent: Tuesday, November 27, 2001 7:20 AM
Subject: [Mono-list] IntegerFormatter


> Derek,
>
> The Nunit test for Sbyte is failing, but the problem seems to be in
> IntegerFormatter.cs.  When the test does ToString("n",
> NumberFormatInfo.InvariantInfo) on an Sbyte with value -128, it should
> produce "(128.00)".  However, instead we get "-128.00".
>
> In fact, from the code it looks like all the integral types never get
> formatted with the parentheses.  Can you have a look at this?  Sorry I
> don't have a patch for you myself :)
>
> Regards,
> Nick
>
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list