Differences From Artifact [f581497f4f]:
- File src/OFNumber.m — part of check-in [ce70e17b38] at 2012-01-05 00:56:18 on branch trunk — Update copyright. (user: js, size: 28335) [annotate] [blame] [check-ins using]
To Artifact [3bd254e0cf]:
- File
src/OFNumber.m
— part of check-in
[0db281bf03]
at
2012-06-11 11:08:47
on branch trunk
— Improve -[OFNumber description].
The %f conversion specifier does not include a decimal point if none is
required. In such cases, append ".0" to indicate that the number is of a
floating point type. (user: js, size: 28581) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 | - copy { return [self retain]; } - (OFString*)description { switch (type) { case OF_NUMBER_BOOL: return (value.bool_ ? @"YES" : @"NO"); case OF_NUMBER_UCHAR: case OF_NUMBER_USHORT: case OF_NUMBER_UINT: case OF_NUMBER_ULONG: | > > | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 | - copy { return [self retain]; } - (OFString*)description { OFMutableString *ret; switch (type) { case OF_NUMBER_BOOL: return (value.bool_ ? @"YES" : @"NO"); case OF_NUMBER_UCHAR: case OF_NUMBER_USHORT: case OF_NUMBER_UINT: case OF_NUMBER_ULONG: |
︙ | ︙ | |||
1165 1166 1167 1168 1169 1170 1171 | case OF_NUMBER_INT64: case OF_NUMBER_SSIZE: case OF_NUMBER_INTMAX: case OF_NUMBER_PTRDIFF: case OF_NUMBER_INTPTR: return [OFString stringWithFormat: @"%jd", [self intMaxValue]]; case OF_NUMBER_FLOAT: | | > > > > > > > | > > > > > > > | 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 | case OF_NUMBER_INT64: case OF_NUMBER_SSIZE: case OF_NUMBER_INTMAX: case OF_NUMBER_PTRDIFF: case OF_NUMBER_INTPTR: return [OFString stringWithFormat: @"%jd", [self intMaxValue]]; case OF_NUMBER_FLOAT: ret = [OFMutableString stringWithFormat: @"%g", value.float_]; if (![ret containsString: @"."]) [ret appendString: @".0"]; [ret makeImmutable]; return ret; case OF_NUMBER_DOUBLE: ret = [OFMutableString stringWithFormat: @"%lg", value.double_]; if (![ret containsString: @"."]) [ret appendString: @".0"]; [ret makeImmutable]; return ret; default: @throw [OFInvalidFormatException exceptionWithClass: isa]; } } - (OFXMLElement*)XMLElementBySerializing { |
︙ | ︙ |