Here ya go: http://bl.ocks.org/2037124
locale agnostic code (as far as possible; wicked number strings such as 1,000 and 1.000 will be treated as having thousands markers instead of decimal , and . respectively, but 1,99 and 7.95 will be parsed correctly. Tested on a US/metric configured machine; you'll have to see if there's any bugs popping up in a German config. (Code contains a slew of console.log test cases, both for 'sensible' and 'illegal' strings.) The bit of lingering closure and locale-detection code in there is left as a removal exercise for the reader. ;-) It's there if you want to tweak the assumptions in the code. Met vriendelijke groeten / Best regards, Ger Hobbelt -------------------------------------------------- web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: [email protected] mobile: +31-6-11 120 978 -------------------------------------------------- On Wed, Mar 14, 2012 at 11:03 AM, hamburger <[email protected]> wrote: > thanks for all the replies. > but I still do not solve my problem. > I made a jsfiddle to demonstrate it. > > http://jsfiddle.net/jgcjA/1/ > > I would like to grab a shown number and calculate with it. > > thanks for any hint in advance. >
