On 12/26/2017 12:27 PM, Stephane Ducasse wrote:
> Hi
>
>
> I'm working on improving the number of named colors we have.
> I got this list
> And I did the following to convert numbers to float and I want to keep
> only max three decimal
"float" and "three decimal" are fundamentally incompatible
My funny was ironical because ;-) :
1. I just learn about this #round: method.
2. it is doing a better job than #roundTo:
3. it is mathematically identical to #roundTo: but use positive power
of 10 whereas the former use negative power of 10. I guess it
produces a different impact on the
BTW rountTo: does not solve my problem.
I will check the printing solution.
On Tue, Dec 26, 2017 at 11:51 PM, Nicolas Cellier
wrote:
> Hi Hilaire,
> it' not just funny: it's the exact case round: was made for.
> Note that there is an opened issue suggesting
Hi nicolas
Thanks for the information of color I was also looking for it. The
other packages that extended color used 1/1000 so I followed the
pattern.
I was thinking that I should use something like "printInexactlyOn:"
Now (too early for my brain to work) but I'm wondering the different
between
Hi Hilaire,
it' not just funny: it's the exact case round: was made for.
Note that there is an opened issue suggesting the removal of round: (no
time to check the exact ref now).
Alternatives if round: is deprecated could be:
(c / 255 roundTo: 1/1000) asFloat.
(c / 255 roundTo: 0.001s) asFloat.
It i s funny to note how #round: message seems to have more success for
that:
0.94201 round: 3.
"0.942"
Le 26/12/2017 à 21:27, Stephane Ducasse a écrit :
0.94201 roundUpTo: 0.001
and the same truncatedTo: 0.001
do not work
--
Dr. Geo
http://drgeo.eu
Hi
I'm working on improving the number of named colors we have.
I got this list
And I did the following to convert numbers to float and I want to keep
only max three decimal
Now I do not get
0.94201 roundUpTo: 0.001
and the same truncatedTo: 0.001
do not work
list collect: [ :each |
|