bugGNUstep - Bugs: bug #60871, NSNumberFormatter does not behave...


bug #60871: NSNumberFormatter does not behave as in Mac OS X

Submitted by:  Larry Campbell <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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 01 Jul 2021 06:13:10 PM UTC, original submission:  

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"

Larry Campbell <lcampbel>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by lcampbel (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7