[squeakland] How can I show a number with thousands seperators

Steve Thomas sthomas1 at gosargon.com
Sun Jul 8 16:01:07 EDT 2012


Well second coolest "when it works" :)

So I was able to change 1000 to '1,000'  but when I used the numeric value
of '1,000' I get 1 instead of 1000 (note already put an enhancement request
in tracker).

So how can I remove translate '1,000' to 1000? Tried method finder, but no
luck using "'1,000'. 1000".
I can think of a couple ways of doing this (ex:  iterate through the
characters and remove commas)   But there really should be an easier more
Etoys friendly way.

Also for internationalization I noticed that the decimal mark is always a
period (even when using German, perhaps they have finally realized we have
a better system, dividing by 10 is too easy and requires no hard fun ;)

Thanks,
Stephen

On Sun, Jul 8, 2012 at 3:02 PM, Steve Thomas <sthomas1 at gosargon.com> wrote:

> Okay, Method Finder has to be the second coolest code tool ever.  I simply
> give an example of what I want to do and it finds it.
>
> FYI to get to Method Finder: CMD-<comma> (CTRL-<comma> on PC, I think) ->
> open... -> method finder
>
> Thanks Bert.
>
> Stephen
>
>
> On Sun, Jul 8, 2012 at 9:02 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>
>> On 07.07.2012, at 16:09, Steve Thomas wrote:
>>
>> > When I set a text's numeric value, I would like to include the
>> thousands separator to make it easier to compare two numbers.
>>
>> It's not built into Etoys.
>>
>> To find the right Squeak method, open a method finder. Give it an
>> example, e.g. "12345. '12,345'". It will look for a method with that
>> receiver giving that result.
>>
>> (this works for methods with arguments, too. E.g. try "2. 3. 8")
>>
>> - Bert -
>>
>> _______________________________________________
>> squeakland mailing list
>> squeakland at squeakland.org
>> http://lists.squeakland.org/mailman/listinfo/squeakland
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20120708/54edbc42/attachment.html>


More information about the squeakland mailing list