Currency symbol

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Currency symbol

Maarten Mostert-2
Hi,

On mavericks I have my language and regional settings as follows.


Now in the class CompositeLocale I added the following handy-path to get the currency symbol from the Local.


getCurrencySymbol

| aString |
aString := (NumberPrintPolicy print: 0 using: self currencyPolicy policy)
asString.
aString :=   aString copyWithout: $0.
aString := aString copyWithout: self currencyPolicy decimalPoint.
aString := aString copyWithout: self currencyPolicy thousandsSeparator.
aString := aString copyWithout: Character space.
aString := aString copyWithout: (Character codePoint: 160).
^aString


The thing with this setting,  locale ID = #en_US_POSIX, making the initial string print with  ‘0.00’  with no possibility to extract the € symbol from it.

What is the reason that VW is so easily mistaken ?

Best regards,

@+Maarten,


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vw-dev] Currency symbol

johnmci
BTW as I've been deep into currency locale thoughts with an app I'm working on is the fact that some currencies don't have fractional parts, so asking for the decimal point might not get you what you think it should.

On Thu, Oct 2, 2014 at 3:01 PM, Maarten Mostert <[hidden email]> wrote:
Hi,

On mavericks I have my language and regional settings as follows.


Now in the class CompositeLocale I added the following handy-path to get the currency symbol from the Local.


getCurrencySymbol

| aString |
aString := (NumberPrintPolicy print: 0 using: self currencyPolicy policy)
asString.
aString :=   aString copyWithout: $0.
aString := aString copyWithout: self currencyPolicy decimalPoint.
aString := aString copyWithout: self currencyPolicy thousandsSeparator.
aString := aString copyWithout: Character space.
aString := aString copyWithout: (Character codePoint: 160).
^aString


The thing with this setting,  locale ID = #en_US_POSIX, making the initial string print with  ‘0.00’  with no possibility to extract the € symbol from it.

What is the reason that VW is so easily mistaken ?

Best regards,

@+Maarten,


_______________________________________________
vw-dev mailing list
[hidden email]
http://lists.cincom.com/cgi-bin/mailman/listinfo/vw-dev




--
===========================================================================
John M. McIntosh <[hidden email]https://www.linkedin.com/in/smalltalk
===========================================================================

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vw-dev] Currency symbol

Kooyman, Les
John:

Did you try 'Locale current currencySymbol' and what does it answer?

Les Kooyman
Cincom Smalltalk Engineering


From: [hidden email] [[hidden email]] on behalf of John McIntosh [[hidden email]]
Sent: Thursday, October 02, 2014 3:05 PM
To: Maarten Mostert
Cc: VW NC; [hidden email]
Subject: Re: [vw-dev] Currency symbol

BTW as I've been deep into currency locale thoughts with an app I'm working on is the fact that some currencies don't have fractional parts, so asking for the decimal point might not get you what you think it should.

On Thu, Oct 2, 2014 at 3:01 PM, Maarten Mostert <[hidden email]> wrote:
Hi,

On mavericks I have my language and regional settings as follows.


Now in the class CompositeLocale I added the following handy-path to get the currency symbol from the Local.


getCurrencySymbol

| aString |
aString := (NumberPrintPolicy print: 0 using: self currencyPolicy policy)
asString.
aString :=   aString copyWithout: $0.
aString := aString copyWithout: self currencyPolicy decimalPoint.
aString := aString copyWithout: self currencyPolicy thousandsSeparator.
aString := aString copyWithout: Character space.
aString := aString copyWithout: (Character codePoint: 160).
^aString


The thing with this setting,  locale ID = #en_US_POSIX, making the initial string print with  ‘0.00’  with no possibility to extract the € symbol from it.

What is the reason that VW is so easily mistaken ?

Best regards,

@+Maarten,


_______________________________________________
vw-dev mailing list
[hidden email]
http://lists.cincom.com/cgi-bin/mailman/listinfo/vw-dev




--
===========================================================================
John M. McIntosh <[hidden email]https://www.linkedin.com/in/smalltalk
===========================================================================

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vw-dev] Currency symbol

Kooyman, Les
In reply to this post by johnmci
Oops, I don't see what version you are using and I am referring to the upcoming VW 8.0.

Les

From: [hidden email] [[hidden email]] on behalf of John McIntosh [[hidden email]]
Sent: Thursday, October 02, 2014 3:05 PM
To: Maarten Mostert
Cc: VW NC; [hidden email]
Subject: Re: [vw-dev] Currency symbol

BTW as I've been deep into currency locale thoughts with an app I'm working on is the fact that some currencies don't have fractional parts, so asking for the decimal point might not get you what you think it should.

On Thu, Oct 2, 2014 at 3:01 PM, Maarten Mostert <[hidden email]> wrote:
Hi,

On mavericks I have my language and regional settings as follows.


Now in the class CompositeLocale I added the following handy-path to get the currency symbol from the Local.


getCurrencySymbol

| aString |
aString := (NumberPrintPolicy print: 0 using: self currencyPolicy policy)
asString.
aString :=   aString copyWithout: $0.
aString := aString copyWithout: self currencyPolicy decimalPoint.
aString := aString copyWithout: self currencyPolicy thousandsSeparator.
aString := aString copyWithout: Character space.
aString := aString copyWithout: (Character codePoint: 160).
^aString


The thing with this setting,  locale ID = #en_US_POSIX, making the initial string print with  ‘0.00’  with no possibility to extract the € symbol from it.

What is the reason that VW is so easily mistaken ?

Best regards,

@+Maarten,


_______________________________________________
vw-dev mailing list
[hidden email]
http://lists.cincom.com/cgi-bin/mailman/listinfo/vw-dev




--
===========================================================================
John M. McIntosh <[hidden email]https://www.linkedin.com/in/smalltalk
===========================================================================

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc