[Mono-devel-list] Comments for NumberFormatter
kazuki at panicode.com
Tue Mar 1 20:12:53 EST 2005
Thank you for comments.
I committed NumberFormatter that improved some points.
Andreas Nahr wrote:
> I checked through the new NumberFormatter Class and found a few points
> that could perhaps be improved:
> * The internal class Numberstore contains things like that at several
> if (v >= 1000000000000000000)
> i = 18;
> else if (v >= 100000000000000000)
> i = 17;
> else if (v >= 10000000000000000)
> i = 16;
> I Think it would make sense to revert the order here because a) in real
> world small numbers are more common than large ones. This code is called
> from other functions which deliver e.g. an byte, which surely never can
> get this big.
> * NumberFormatter contains several private classes. Some (all?) could
> likely be converted to structs which should help improve performance and
> reduce memory usage.
> * There are several places were Strings are used but Chars could be used
> instead (like " ")
> * The following line in FormatExponential is really hard to read and
> should be refactored:
> return string.Concat ("0", precision > 0 ? "." + new string ('0',
> precision) : "", upper ? "E" : "e", nfi.PositiveSign, "000");
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
More information about the Mono-devel-list