[Pkg] The Trunk: Kernel-nice.716.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Nov 5 20:45:23 UTC 2012


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.716.mcz

==================== Summary ====================

Name: Kernel-nice.716
Author: nice
Time: 5 November 2012, 9:44:23.181 pm
UUID: 2d5c476b-182b-4c53-a260-ed0da80e0bff
Ancestors: Kernel-eem.715

Let (0.0 printShowingDecimalPlaces: 2) = '0.00'

=============== Diff against Kernel-eem.715 ===============

Item was changed:
  ----- Method: Float>>printOn:showingDecimalPlaces: (in category 'printing') -----
  printOn: aStream showingDecimalPlaces: placesDesired
  	"Refine super implementation in order to avoid any rounding error caused by rounded or roundTo:"
  	
  	self isFinite ifFalse: [^self printOn: aStream].
  	self > 0.0
  		ifTrue: [self absPrintExactlyOn: aStream base: 10 decimalPlaces: placesDesired showTrailingFractionalZeros: true]
  		ifFalse:
  			[self sign = -1
  				ifTrue: [aStream nextPutAll: '-'].
  			self = 0.0
+ 				ifTrue:
+ 					[aStream nextPut: $0.
+ 					placesDesired > 0 ifTrue: [aStream nextPut: $.; next: placesDesired put: $0]]
- 				ifTrue: [aStream nextPutAll: '0.0']
  				ifFalse: [self absPrintExactlyOn: aStream base: 10 decimalPlaces: placesDesired showTrailingFractionalZeros: true]]!



More information about the Packages mailing list