see attached TestTool

-- 
Pirmin Braun - IntarS Unternehmenssoftware GmbH - Am Hofbräuhaus 1 - 96450 
Coburg
+49 2642 40526292 +49 174 9747584 - skype:pirminb www.intars.de  p...@intars.de
Geschäftsführer: Pirmin Braun, Ralf Engelhardt Registergericht: Amtsgericht 
Coburg HRB3136
Output on WO YellowBox:
Jan 19 23:23:38 TestTool[10392] 0.01
Jan 19 23:23:38 TestTool[10392] 0.01
Jan 19 23:23:38 TestTool[10392] 0.02
Jan 19 23:23:38 TestTool[10392] 0.02

Output on GNUstep
URL: http://svn.gna.org/svn/gnustep/libs/base/trunk
Repository Root: http://svn.gna.org/svn/gnustep
Revision: 37216

2014-01-19 23:23:15.709 TestTool[7623] 0.01
2014-01-19 23:23:15.712 TestTool[7623] 0.0
2014-01-19 23:23:15.712 TestTool[7623] 0.02
2014-01-19 23:23:15.712 TestTool[7623] 0.02


Source:
int
main(int argc, char **argv)
{
    NSAutoreleasePool *pool =[NSAutoreleasePool new];
    NSDecimalNumberHandler *nh = [[[NSDecimalNumberHandler 
alloc]initWithRoundingMode:NSRoundPlain scale:2 raiseOnExactness:NO 
raiseOnOverflow:NO raiseOnUnderflow:NO raiseOnDivideByZero:NO]autorelease];


    NSLog(([[[NSString alloc]initWithFormat:@"%0.2f",0.009]autorelease]));
    NSLog([[[NSDecimalNumber decimalNumberWithString:@"0.009"] 
decimalNumberByRoundingAccordingToBehavior:nh]description]);

    NSLog(([[[NSString alloc]initWithFormat:@"%0.2f",0.019]autorelease]));
    NSLog([[[NSDecimalNumber decimalNumberWithString:@"0.019"] 
decimalNumberByRoundingAccordingToBehavior:nh]description]);


    [pool release];


    exit (0);
    return 0;
}
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to