URL: <https://savannah.gnu.org/bugs/?60871>
Summary: NSNumberFormatter does not behave as in Mac OS X Project: GNUstep Submitted by: lcampbel Submitted on: Thu 01 Jul 2021 06:13:10 PM UTC Category: Base/Foundation Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: The following snippet demonstrates an incompatibility with Mac OS X. On Mac OS X the test succeeds; on gnustep-base (linux, libicu) the test fails, returning ".9" instead of "0.9". NSNumberFormatter *nf = [[NSNumberFormatter new] autorelease]; NSString *expected = @"0.9"; NSString *got; [nf setMaximumFractionDigits:3]; got = [nf stringFromNumber:[NSNumber numberWithDouble:0.9]]; NSAssert([expected isEqualToString:got], @"number formatter botch, expected \"%@\", got \"%@\"", expected, got); On linux: 2021-07-01 18:09:42.517 gnustep-base-tests[55286:55286] gnustep-base-tests.m:593 Assertion failed in GnustepBaseTests(instance), method numberFormatterTest. number formatter botch, expected "0.9", got ".9" _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?60871> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/