1. question on set()
- Posted by Salix Nov 19, 2010
- 1047 views
I am bit confused. Was the set() routine used incorrectly here? What am I expected to see here?
include std/locale.e include std/localeconv.e ? set("en_US") -- returns 0 ? money(1020.5) -- returns {49,48,50,48,46,53,48} ? number(1020.5) -- returns {49,48,50,48,46,53,48} ? get() -- returns {67}
Regards,
Salix
2. Re: question on set()
- Posted by mattlewis (admin) Nov 19, 2010
- 1024 views
Salix said...
I am bit confused. Was the set() routine used incorrectly here? What am I expected to see here?
I think it depends on your machine. I got the same thing you did. However:
include std/locale.e include std/localeconv.e include std/console.e display( set("en_US.UTF-8") ) display( money(1020.5) ) display( number(1020.5) ) display( get() )
...gets me...
1 $1,020.50 1,020.50 en_US.UTF-8
So, the call to set was failing because you don't have that locale installed. On Linux, at least, you can do:
$ echo $LANG
...to figure out your current locale. I'm not sure if that works on Windows. And with that, I've about exhausted my knowledge of locales.
Matt
3. Re: question on set()
- Posted by Salix Nov 19, 2010
- 1046 views
I see now. Your example code would be a great addition to the manual.
Thank you!