diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-19 19:01:31 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-19 19:01:31 +0200 |
commit | af5a200a68ed12efec4b29b57fa22c632aaf91fa (patch) | |
tree | bdbec22869a15b2a41371a2507a74b852ee6704e /MLKRatio.m | |
parent | f9f90837641694619d184cf2ab8b5c03c46b08dd (diff) |
Fix number parsing.
Diffstat (limited to 'MLKRatio.m')
-rw-r--r-- | MLKRatio.m | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -41,6 +41,7 @@ self = [super init]; mpq_init (value); mpq_set_str (value, [string UTF8String], 10); + mpq_canonicalize (value); return self; } @@ -49,8 +50,8 @@ negative:(BOOL)negative base:(unsigned int)base { - return [self initWithString:[NSString stringWithFormat:@"%c%@/%@", - (negative ? '-' : '+'), + return [self initWithString:[NSString stringWithFormat:@"%s%@/%@", + (negative ? "-" : ""), numerString, denomString] base:base]; |