HighDots Forums  

Default Decimal separator for float parsing and printing

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Default Decimal separator for float parsing and printing in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sloubi
 
Posts: n/a

Default Default Decimal separator for float parsing and printing - 06-30-2009 , 01:43 PM






Hi,
Here is my pb.
I have an application where user can fill float values into <INPUT>

I have to localize my application according to the user definition, not
according to the browser.
So, in France I need the comma, in England it's the dot.

I know the rought solution consisting in 'replacing" dot by comma or
reverse, but:
- it's not clean
- it raises performance considerations, as I manipulate hudge pack of
numbers (matrix or table).

Is there a way to "force" the localization by default?

Regards


Francillo

Reply With Quote
  #2  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: Default Decimal separator for float parsing and printing - 07-01-2009 , 11:54 AM






In comp.lang.javascript message <4a4a4ea5$0$3611$426a74cc (AT) news (DOT) free.fr>,
Tue, 30 Jun 2009 19:43:03, sloubi <sloubi (AT) top (DOT) fr> posted:
Quote:
Hi,
Here is my pb.
S'il vous plaît ne pensez pas que les abréviations qui peuvent être
d'usage en français seraient satisfaisante en anglais; on ne devrait
jamais introduire les abréviations lors de l'écriture d'une langue avec
laquelle on ne parle pas couramment.

Quote:
I have an application where user can fill float values into <INPUT

I have to localize my application according to the user definition, not
according to the browser.
So, in France I need the comma, in England it's the dot.

I know the rought solution consisting in 'replacing" dot by comma or
reverse, but:
- it's not clean
- it raises performance considerations, as I manipulate hudge pack of
numbers (matrix or table).

Have you determined whether the necessary substitution will have a
perceptible influence on performance? Firefox 3, 3GHz P4, can convert
"12345,67" to "12345.67" in under 5 us. Very few users can type a
number accurately in less than 200 ms.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.