[Seaside] Re: Pharo 2.0 scriptaculous does not work
Torsten Bergmann
astares at gmx.de
Mon Jun 10 17:41:30 UTC 2013
Paul DeBruicker wrote:
>On 06/07/2013 05:23 PM, Markus Fritsche wrote:
>> 10.2s2 asMoney: #EUR prints EUR 10..20.20
>
>
>Thats weird. On Pharo 1.4 & 2 it prints:
>
> EUR 10.20
It's not weird, it just depends on locales in the implementation and is broken for locales like german
that use $, as a money separator (EUR 10,20)
If you look at:
printSeparated: aNumber on: aStream
| s n n1 sz |
s := aNumber printShowingDecimalPlaces: 2.
n := s copyUpTo: self decimal.
...
you will see that it copies up to the return value of "self decimal".
This is implemented as following:
decimal
^Locale current primDecimalSymbol first
and returns either $. or $, (on german locales).
If you use
printSeparated: aNumber on: aStream
| s n n1 sz |
s := aNumber printShowingDecimalPlaces: 2.
n := s copyUpTo: $..
...
it will always work and format locale independent as "EUR 10.20"
Will you move the project to STHub for adopting for Pharo >= 2.0 and for others to contribute?
Thx
T.
More information about the seaside
mailing list