I thought the parse statement would throw an error. But it parses the string successfully and gives me a number 123.
How can I make it throw an error for such numbers which are wrong from French locale perspective?
Should that code throw an error? You explicitly set the thousands seperator to a blank space (ignoring the value set for the French locale which should be '.' I think) then parse a number less than 1000 so the 1000s seperator won't be used anyway. Or am I missunderstanding what you are trying to do?
I presume, Paul, the group separator will be accepted providing it appears in a regular location. In some number systems (I think commonly in India) the group separator comes evry 4th digit rather than every 3rd. So I tried it; some of the following code is copied and pasted from Rahul Vhatkar's:So that is obviously not the explanation. I couldn't get much farther by reading the DecimalFormat and DecimalFormatSymbols documentation. Sorry.
Anybody else know?
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad: