Why is it important to you to have a float? Once you've truncated it, you have a rational number, by definition. Are you sure you want to truncate the number, rather than performing the truncation in the presentation layer?
On Wed, Jul 23, 2008 at 10:34 AM, cdrick cdrick65@gmail.com wrote:
Float has a truncate and round off protocal with metods that truncate and round to integer.
So it looks you have to do something like
(aFloat * (10^desiredDecimals) + 0.5) truncated / (10^desiredDecimals)
or without the + 0.5 for truncation.
close to what I proposed earlier ;-) Just need a conversion to Float as it returns a fraction.
so no existing method... Isn't it something common ? _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners