In comp.lang.javascript message <11**********************@i80g2000cwc.go
oglegroups.com>, Thu, 4 Jan 2007 02:07:31, hygum <th*********@gmail.com>
posted:
>I've found a useful script that only accepts numbers and a point, and 3
decimals, in an input. But here in denmark we normally use comma as
decimal delimiter in numbers, not the point (.) as in english-speaking
countries.
Can somebody help me making this javascript accept comma as delimiter
in the input? I'm thinking that the best solution is that the script
converts comma to a point, when the user input a comma.
See <URL:http://www.merlyn.demon.co.uk/js-maths.htm#DPV>.
In practice, to get a Number from a control Ctrl,
function DaneRead(Ctrl) { return +Ctrl.value.replace(/,/, '.') }
It's a good idea to read the newsgroup and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.