I will add something like Number>>percent
^Percentage of: self
And Percentage value should be The number / 100, the printOn: can show the % sign, something like '50 %'. Obviously this must behave exactly as a number. This allows to be extended in case something specific is needed for percentages. (I can use it in RenoirSt and remove one of the extensions I have)
Too bad % is used as a binary selector :( . Writing 32 % is a lot better
What do you think of this in core? Like a mini Aconcagua ;)
�� �� Number>>#percent
�� �� �� �� "e.g. 20 / 40 = 50 percent"
�� �� �� �� ^ self / 100.0
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Number-percent-tp4805988.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.