1. question on set()

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

new topic     » topic index » view message » categorize

2. Re: question on set()

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. smile

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: question on set()

I see now. Your example code would be a great addition to the manual.

Thank you!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu