[squeak-dev] The Trunk: Kernel-nice.614.mcz
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Thu Sep 8 06:16:05 UTC 2011
2011/9/7 Levente Uzonyi <leves at elte.hu>:
> On Wed, 7 Sep 2011, commits at source.squeak.org wrote:
>
>> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-nice.614.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-nice.614
>> Author: nice
>> Time: 7 September 2011, 7:10:52.779 pm
>> UUID: 8b421fd9-75f4-2e44-bef4-9bbf5cd3b57a
>> Ancestors: Kernel-nice.613
>>
>> Let (ScaledDecimal newFromNumber: 0.0 scale: 2) print itself.
>>
>> While at it, review ScaledDecimal comment and indicate that the fraction
>> inst var can be an Integer eventually.
>>
>> =============== Diff against Kernel-nice.613 ===============
>>
>> Item was added:
>> + ----- Method: Integer>>printTruncatedOn:showingDecimalPlaces: (in
>> category 'printing') -----
>> + printTruncatedOn: aStream showingDecimalPlaces: placesDesired
>> + "Print a representation of the receiver on aStream in decimal
>> notation with prescribed number of places after decimal separator.
>> + Print as if the receiver was truncated to requested precision."
>> +
>> + self printOn: aStream.
>> + placesDesired > 0
>> + ifTrue:
>> + [aStream nextPut: $..
>> + aStream nextPutAll: (String new: placesDesired
>> withAll: (Character digitValue: 0))]!
>
> Wouldn't
>
> aStream
> nextPut: $.;
> next: placesDesired put: $0
>
> be better here? I mean $0 is the character we want to see and not something
> language specific (especially after using $. for the decimal separator).
> Also creating a string seems to be overkill for most cases. I'm just
> nitpicking, but couldn't stand to ask. :)
>
>
> Levente
>
> snip
>
>
Sure, please proceed.
More information about the Squeak-dev
mailing list
|