Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure you'll be able to get an elegant way of figuring this out, because it's always going to be ambigious if you can't tell it where the data is from.</p> <p>For example, the numbers 1.234 and 1,234 are both valid numbers, but without establishing what the symbols mean you won't be able to tell which is which.</p> <p>Personally, I would write a function which attempted to do a "best guess" based on some rules...</p> <ul> <li>If the number contains <code>,</code> BEFORE <code>.</code>, then <code>,</code> must be for thousands and <code>.</code> must be for decimals</li> <li>If the number contains <code>.</code> BEFORE <code>,</code>, then <code>.</code> must be for thousands and <code>,</code> must be for decimals</li> <li>If there are >1 <code>,</code> symbols, the thousand separator must be <code>,</code></li> <li>If there are >1 <code>.</code> symbols, the thousand separator must be <code>.</code></li> <li>If there is only 1 <code>,</code> how many numbers follow it? If it's NOT 3, then it must be the decimal separator (same rule for <code>.</code>)</li> <li>If there are 3 numbers separating it (e.g. 1,234 and 1.234), perhaps you could put this number aside and parse other numbers on the same page to try and figure out if they use different separators, then come back to it?</li> </ul> <p>Once you've figured out the decimal separate, remove any thousand separators (not needed for parsing the number) and ensure the decimal separator is . in the string you are parsing. Then you can pass this into <code>Double.TryParse</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload