HighDots Forums  

Math functions in different cultures

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


Discuss Math functions in different cultures in the JavaScript discussion (multi-lingual) forum.



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

Default Math functions in different cultures - 02-22-2006 , 11:07 AM






Hi:

I need to write some number formatting code that can work in different
countries. Since different cultures use different characters for group
and decimal separators, I am concerned how the Math functions will be
able to parse values typed in with different separator characters.

I want to allow my users to enter a "," for a decmial place if that is
what their culture does.

Do I need to first convert the comma to a "." for Math.round to
successfully parse a number? Or if that browser has been set up for
say, fr-FR, do I need the decimal character that the fr-FR culture
specifies?

Any idea how browsers handle the string to number context conversion in
different locales? I cannot find good information on this.


Reply With Quote
  #2  
Old   
SSim
 
Posts: n/a

Default Re: Math functions in different cultures - 03-22-2006 , 09:39 AM






With a programming language written from an English base you most
likely will have to do conversions of the type you mentioned. Those
types of conversions could potentially be solved through the use of a
only a few functions that convert to string, translate the applicable
characters, then return the value in its original form but consistant
with what the programming language expects. Sorry I don't have code
examples for you right off hand.


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 - 2008, Jelsoft Enterprises Ltd.